zsh-users
 help / color / mirror / code / Atom feed
From: "Benjamin R. Haskell" <zsh@benizi.com>
To: Matt Wozniski <godlygeek@gmail.com>
Cc: zsh-users@zsh.org
Subject: Re: Completion style like Vim
Date: Tue, 16 Nov 2010 16:21:06 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.01.1011161618480.2792@hp> (raw)
In-Reply-To: <alpine.LNX.2.01.1011161606310.2792@hp>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1515 bytes --]

[attempt two -- not sure if the original ever hit the current zsh-users 
address]

On Tue, 16 Nov 2010, Matt Wozniski wrote:

> On Tue, Nov 16, 2010 at 3:09 PM, Benjamin R. Haskell wrote:
> > On Tue, 16 Nov 2010, Michael Treibton wrote:
> > 
> > > Hi all,
> > > 
> > > I'm wondering how i can get vim-like completion with zsh, and even 
> > > if it's possible?
> > > 
> > > For those who don't know, vim allows completion to happen on one 
> > > line, so if I have entered the following commands:
> > > 
> > > foobar hello
> > > bar baz hello
> > > zsh is cool
> > > zsh is really cool
> > > 
> > > ... and I were to type in:
> > > 
> > > zsh is
> > > 
> > > and then press the up or down arrow keys, I would see as 
> > > completion:
> > > 
> > > zsh is cool
> > > zsh is really cool
> > 
> > That's not how my Vim completion works.  (Big fan of the popupmenu 
> > and supertab.)  I guess you like i_CTRL-X_CTRL-L?  I much prefer 
> > i_CTRL-X_CTRL-O for the general case, falling back to 
> > i_CTRL-X_CTRL-I. (Both of which I access via '<Tab>'.)
> 
> Michael was describing how it works in command-line mode, not insert 
> mode.
> 

Ah, yep.  There's the disconnect.  I do too much with Vim's 
insert-completion to think of that as "completion".

In any case, the following seems to work like Vim's command-line 
completion:

bindkey "^[[A" history-beginning-search-backward
bindkey "^[[B" history-beginning-search-forward

^[[A == up arrow, ^[[B == down.  Sounds like you want ^n and ^p, too.

-- 
Best,
Ben

  parent reply	other threads:[~2010-11-16 21:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 19:57 Michael Treibton
2010-11-16 20:09 ` Benjamin R. Haskell
     [not found]   ` <AANLkTimqY0yVW-uHNi_pKMYRjTZJ7a1CamENMs2CpCQs@mail.gmail.com>
     [not found]     ` <alpine.LNX.2.01.1011161606310.2792@hp>
2010-11-16 21:21       ` Benjamin R. Haskell [this message]
2010-11-17 22:43         ` Michael Treibton
2011-01-20 21:02           ` Michael Treibton
2011-01-20 22:02             ` Benjamin R. Haskell
2011-01-20 22:14               ` Michael Treibton
2011-01-23  4:56                 ` Bart Schaefer

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=alpine.LNX.2.01.1011161618480.2792@hp \
    --to=zsh@benizi.com \
    --cc=godlygeek@gmail.com \
    --cc=zsh-users@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).