From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14072 invoked by alias); 26 Nov 2015 13:08:04 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37223 Received: (qmail 12810 invoked from network); 26 Nov 2015 13:08:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Christian Neukirchen Subject: Re: Interactive search on the command line? Date: Thu, 26 Nov 2015 13:50:33 +0100 Message-ID: <87si3sgc12.fsf@gmail.com> References: <20151126080400.GA20074@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: host248-2.natpool.mwn.de In-Reply-To: (Mikael Magnusson's message of "Thu, 26 Nov 2015 09:20:40 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Mikael Magnusson writes: > On Thu, Nov 26, 2015 at 9:04 AM, Dominik Vogt 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 http://chneukirchen.org