From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9020 invoked from network); 6 Jun 2020 05:38:07 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 6 Jun 2020 05:38:07 -0000 Received: (qmail 29551 invoked by alias); 6 Jun 2020 05:37:58 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24907 Received: (qmail 28806 invoked by uid 1010); 6 Jun 2020 05:37:58 -0000 X-Qmail-Scanner-Diagnostics: from wout4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25828. spamassassin: 3.4.4. Clear:RC:0(64.147.123.20):SA:0(-2.6/5.0):. Processed in 4.871793 secs); 06 Jun 2020 05:37:58 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeggedgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfgjfhfogggtgfesthhqtddtredtjeenucfhrhhomhepffgrnhhi vghlucfuhhgrhhgrfhcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvgeqne cuggftrfgrthhtvghrnhephfdtteefheevuedthedutdeifeegteettdejtdffheduieei jeelteetkeduteehnecukfhppeejledrudejiedrfeelrdeileenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhh rghhrghfrdhnrghmvg X-ME-Proxy: Date: Sat, 6 Jun 2020 05:37:14 +0000 From: Daniel Shahaf To: Marlon Richert Cc: zsh-users@zsh.org Subject: Re: How to make completion menu select navigation not wrap around? Message-ID: <20200606053714.451d337a@tarpaulin.shahaf.local2> In-Reply-To: References: X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Marlon Richert wrote on Sat, 04 Apr 2020 18:06 +0300: > When using arrow keys to navigate the completion menu, I do not want it to > wrap around (to the bottom row) when I press the up arrow key when I=E2= =80=99m on > the top row of the menu. Instead, I want to go back to the command line. >=20 > Is there a zstyle to turn off menu wrapping? Or inside a widget function, > is there a parameter or function I can query to tell if the menu is open > and which line we=E2=80=99re on (so that I can then `send-break` instead = of doing > `up-line`)? Sorry for the late answer. The =C2=ABmenuselect=C2=BB map can be used to b= ind keys for navigating the menu, for example, to use Vi-like hjkl navigation: bindkey -M menuselect "h" backward-char bindkey -M menuselect "j" down-line-or-history bindkey -M menuselect "k" up-line-or-history bindkey -M menuselect "l" forward-char So I suppose you could bind up/down to functions that decrement/increment a global counter respectively, and have the "up" function send-break when the counter reaches zero. Won't be perfect, since pressing repeatedly can move to the next line, but might work "well enough" in practice. Cheers, Daniel