Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion style like Vim
- X-seq: zsh-users 15556
- From: Michael Treibton <mtreibton@xxxxxxxxxxxxxx>
- To: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- Subject: Re: Completion style like Vim
- Date: Wed, 17 Nov 2010 22:43:38 +0000
- Cc: Matt Wozniski <godlygeek@xxxxxxxxx>, zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=4vNs1L8W0YqJy7LXVaGqVOoDYzOMc4aA0DL89+ppTSE=; b=hrl6j00eJNnHYWy2Yt7lJ5QAvtnnNccXv1+EttCGL35occRfXojYGB1wt0YmQ1RzNd FG8SzdbzF9hhIDxPIblbTTiMY/i/yDlMEP7S7/H+DPS9iMdV+fXJe/ikeVqhS/Za26Ae Dj1qZstD/wHdGuf/iV6bHqur8gPQRAIlKlvC0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=XHi9OQBAsTvxEGwqSgInbSeVj7/ztZuX1nHJ0KvU9kM6zIaA3xfcifwVqaXJ5Kon6g nwDJ+oon8eyfNlwOt9nlOYxsMnvW5GLKw8qqEcbVojg3Cii9+08rYmh+jU1875wrP2ix ZIfF6/Sbv30wwz+stMGDC5iOd5TmJIb74BXoo=
- In-reply-to: <alpine.LNX.2.01.1011161618480.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> <alpine.LNX.2.01.1011161618480.2792@hp>
Ben --
[ Sorry about the off-list reply -- that's gmail being a pain.
Hopefully I've sorted that now. ]
On 16 November 2010 21:21, Benjamin R. Haskell <zsh@xxxxxxxxxx> wrote:
> [attempt two -- not sure if the original ever hit the current zsh-users
> address]
>
> On Tue, 16 Nov 2010, Matt Wozniski wrote:
>> Michael was describing how it works in command-line mode, not insert
>> mode.
Thanks, Matt. Apologies for not being very clear before. I suppose
to me it was obvious what I meant by "completion" in terms of ":" mode
in VIm. But it looks like we're all singing from the same hymn sheet
now. :)
>
> 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.
Thanks, Ben. This works exactly as I want, except for one thing --
the cursor position.
Let's say I have this in my history:
get_foo
get_bar
... and assume also that I've got your bindings configured (which I do) as:
bindkey "^[[A" history-beginning-search-backward
bindkey "^[[B" history-beginning-search-forward
If I type in (at the zsh prompt):
get_
and press the up-arrow key and down-arrow key, the cursor position
remains after the underscore. Ideally, I'd love it if the cursor,
when pressed in either up or down direction could complete the line,
*and* move to the end of the line, because now, I find myself having
to do this:
get_
press "up-arrow", and then press "End", because actually I made a typo
at the end of the line I need to correct and/or was missing some
options from the command in the first place. With my previous
bindings for those arrow-keys, this cursor-position was not a problem.
I have no doubt zsh can do this, and I am learning about it all the
time -- and I appreciate your help and Matt's so far. So any insights
you might have are warmly appreciated. :)
TIA,
Michael
Messages sorted by:
Reverse Date,
Date,
Thread,
Author