Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Completion style like Vim



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

which would be cycled through on the single line -- that is, without presenting the completion menu.

Is something like this possible with zsh (and I assume zle?) Note that I already use the following bindings:

bindkey '\e[5~' beginning-of-buffer-or-history
bindkey '\e[6~' end-of-buffer-or-history
bindkey "^[n" history-search-forward
bindkey "^[p" history-search-backward

Which don't quite do what I want.

Is this possible at all?  I hope I've explained this well enough.

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>'.)

From your description, though, I think you're looking for:

history-beginning-search-{forward,backward}

(Someone complained about the name recently, but the gist of 'beginning-' is that it searches from the beginning of the line entered thus far.)

--
Best,
Ben



Messages sorted by: Reverse Date, Date, Thread, Author