Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion style like Vim
- X-seq: zsh-users 15719
- From: Michael Treibton <mtreibton@xxxxxxxxxxxxxx>
- To: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- Subject: Re: Completion style like Vim
- Date: Thu, 20 Jan 2011 21:02:59 +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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=1aI8aVb8YEiErZA7YXbzINDBvXRjqaGcGctcwIY21IA=; b=mK4d6Vrz9+m79isDHVax2BKXMEXO3Or4y2igcH7wcQdEDuFPOcSj1/b+LrDbi4QkL4 fDdgnO2oxbrx3SZHenM9rJ4yQc6WqtM6OQ89kt2t41paXZk2pY4u2qMgsZRP8VhZB4SI Ls5Wj2CAN32oBtXKO4du4bSIX2es0DsexP8bo=
- 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=KAt7ELA+w8aqIUPuEXgmRL4NB3v2wrJeUoMockT2LCE434opZtpxXbSsy/9/hU0eLy 6rNBMWGGVBoMhxMnferQjMR1lZjKBl01yUPw5kIZhtz5a9PJeG2YPXDGtif5851MXE9O WlMRDtenQX3me4+yhYkUpv60Yf1iE8viZWCKM=
- In-reply-to: <AANLkTinMs=GaCcg6=AtM89L1jANjmciYZp9ZJqk3AbTQ@mail.gmail.com>
- 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@mail.gmail.com> <alpine.LNX.2.01.1011161503010.2792@hp> <AANLkTimqY0yVW-uHNi_pKMYRjTZJ7a1CamENMs2CpCQs@mail.gmail.com> <alpine.LNX.2.01.1011161606310.2792@hp> <alpine.LNX.2.01.1011161618480.2792@hp> <AANLkTinMs=GaCcg6=AtM89L1jANjmciYZp9ZJqk3AbTQ@mail.gmail.com>
Hi all --
On 17 November 2010 22:43, Michael Treibton <mtreibton@xxxxxxxxxxxxxx> wrote:
> 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. :)
Was there any ideas on this, may I ask?
TIA,
Michael
Messages sorted by:
Reverse Date,
Date,
Thread,
Author