zsh-workers
 help / color / mirror / code / Atom feed
From: Christian Neukirchen <chneukirchen@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: Interactive search on the command line?
Date: Thu, 26 Nov 2015 13:50:33 +0100	[thread overview]
Message-ID: <87si3sgc12.fsf@gmail.com> (raw)
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")

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


           reply	other threads:[~2015-11-26 13:08 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CAHYJk3RcquNSfXnnYO-ORvPzm8OP-8RWYA+nCJfrrvRaaqwBjg__18264.3025917516$1448526135$gmane$org@mail.gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87si3sgc12.fsf@gmail.com \
    --to=chneukirchen@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).