zsh-workers
 help / color / mirror / code / Atom feed
* Re: Interactive search on the command line?
       [not found] ` <CAHYJk3RcquNSfXnnYO-ORvPzm8OP-8RWYA+nCJfrrvRaaqwBjg__18264.3025917516$1448526135$gmane$org@mail.gmail.com>
@ 2015-11-26 12:50   ` Christian Neukirchen
  0 siblings, 0 replies; only message in thread
From: Christian Neukirchen @ 2015-11-26 12:50 UTC (permalink / raw)
  To: zsh-workers

Mikael Magnusson <mikachu@gmail.com> writes:

> On Thu, Nov 26, 2015 at 9:04 AM, Dominik Vogt <vogt@linux.vnet.ibm.com> wrote:
>> Is there a way to do an interactive search (or at least a
>> non-interactive string search) in the command line editor?  I
>> often have extremely long gcc command lines where I want to delete
>> an option or do some editing in the middle of the command line,
>> and moving the cursor to the interesting spot is quite tedious.
>
> You can use ctrl-r for this. (eg, history-incremental-*-search-*).
>
> Another useful trick on long command lines is to type alt-300 or some
> suitably large number before pressing left/right.

I use this, and then ESC-Up/ESC-Down:

# Move by physical lines, like gj/gk in vim
# 09apr2013  +chris+
_physical_up_line()   { zle backward-char -n $COLUMNS }
_physical_down_line() { zle forward-char  -n $COLUMNS }
zle -N physical-up-line _physical_up_line
zle -N physical-down-line _physical_down_line
bindkey "\e\e[A" physical-up-line
bindkey "\e\e[B" physical-down-line

-- 
Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-26 13:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20151126080400.GA20074@linux.vnet.ibm.com>
     [not found] ` <CAHYJk3RcquNSfXnnYO-ORvPzm8OP-8RWYA+nCJfrrvRaaqwBjg__18264.3025917516$1448526135$gmane$org@mail.gmail.com>
2015-11-26 12:50   ` Interactive search on the command line? Christian Neukirchen

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).