Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion style like Vim
- X-seq: zsh-users 15553
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: Matt Wozniski <godlygeek@xxxxxxxxx>
- Subject: Re: Completion style like Vim
- Date: Tue, 16 Nov 2010 16:21:06 -0500 (EST)
- Cc: zsh-users@xxxxxxx
- In-reply-to: <alpine.LNX.2.01.1011161606310.2792@hp>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <AANLkTimRCvWA=0pchndFrkTF8Q0_gc4QA18JGD29Y-ti@xxxxxxxxxxxxxx> <alpine.LNX.2.01.1011161503010.2792@hp> <AANLkTimqY0yVW-uHNi_pKMYRjTZJ7a1CamENMs2CpCQs@xxxxxxxxxxxxxx> <alpine.LNX.2.01.1011161606310.2792@hp>
[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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author