Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Interactive search on the command line?
- X-seq: zsh-workers 37223
- From: Christian Neukirchen <chneukirchen@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Interactive search on the command line?
- Date: Thu, 26 Nov 2015 13:50:33 +0100
- In-reply-to: <CAHYJk3RcquNSfXnnYO-ORvPzm8OP-8RWYA+nCJfrrvRaaqwBjg__18264.3025917516$1448526135$gmane$org@mail.gmail.com> (Mikael Magnusson's message of "Thu, 26 Nov 2015 09:20:40 +0100")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20151126080400.GA20074@linux.vnet.ibm.com> <CAHYJk3RcquNSfXnnYO-ORvPzm8OP-8RWYA+nCJfrrvRaaqwBjg__18264.3025917516$1448526135$gmane$org@mail.gmail.com>
Mikael Magnusson <mikachu@xxxxxxxxx> writes:
> On Thu, Nov 26, 2015 at 9:04 AM, Dominik Vogt <vogt@xxxxxxxxxxxxxxxxxx> 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@xxxxxxxxx> http://chneukirchen.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author