* bck-search in vicmd is not thinking vi-style
@ 2010-04-07 15:55 Maryam
2010-04-07 16:43 ` Bart Schaefer
2010-04-08 9:35 ` Thor Andreassen
0 siblings, 2 replies; 7+ messages in thread
From: Maryam @ 2010-04-07 15:55 UTC (permalink / raw)
To: zsh-users
10:56 < glphvgacs> ft: hi, while user isearches in vicmd mode; is it
possible to hit some key (tab?) to run through the possible hits
(something like menu-completion)?
11:22 < glphvgacs> a key for reapeating bck-i-search that is not
emac-style i.e. '^r'
11:24 < Mikachu> you can bind keys in the isearch keymap
11:24 < Mikachu> if that helps
11:27 < glphvgacs> Mikachu: I have this bindkey -M vicmd 'f'
history-incremental-search-backward
11:27 < Mikachu> obviously you can't use f in isearch since i assume
you want to be able to type f
11:27 < glphvgacs> but that's just to start isearch
11:27 < Mikachu> but you could try bindkey -M isearch '^I'
history-incremental-search-backward
11:32 < glphvgacs> vimperator guys have a nice feature to open a
location; user hits 'o' and starts typing then user gets a list of
possible completions and then (here is the good part) user can <tab>
through the results. i don't think i can search for <tab> in my search
history so having that key doing nothing during bck-search and then
introducing an extra key to hold (in the case of '^r' or as you
suggested '^I') seems redundant, i think
11:34 < glphvgacs> i mean then whole idea of going vicmd to me at
least to to get rid of that extra '^' in emacs, to thing vi as opposed
to emacs, right?
11:34 < Mikachu> ^I is tab
11:34 -!- bapt is now known as aigrbapt
11:34 < glphvgacs> nice
11:34 < Mikachu> it took me a while to realize that isn't immediately
obvious to everyone
11:36 < glphvgacs> so empty line + ^I brings up bck-search
11:36 < glphvgacs> i was thinking I as in Increment
11:36 < glphvgacs> thnx
11:36 < Mikachu> after going into the searhc mode, pressing tab should
be the same as pressing ctrl-r again in emacs mode
11:37 * Mikachu disappears
11:37 < glphvgacs> yeah, not really
11:38 < glphvgacs> it doesn't do what i wanted but still a nice touch
Can someone help me figure this out? thnx.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: bck-search in vicmd is not thinking vi-style
2010-04-07 15:55 bck-search in vicmd is not thinking vi-style Maryam
@ 2010-04-07 16:43 ` Bart Schaefer
2010-04-07 18:21 ` Maryam
2010-04-08 9:35 ` Thor Andreassen
1 sibling, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2010-04-07 16:43 UTC (permalink / raw)
To: zsh-users
On Apr 7, 11:55am, Maryam wrote:
}
} Can someone help me figure this out? thnx.
Figure out which part? There's a whole conversation there ...
If you mean the original question about invoking tab-completion during
incremental search: It can't be done in a straightforward way.
Incremental search is a self-contained widget, you can't escape from
it to go into completion and then come back to where you left off.
It can probably be done by implementing your own incremental search
widget as a completion widget; see e.g., the incremental-complete-word
widget in the distribution. In fact this *might* work:
# Choose another binding at your preference
autoload -U incremental-complete-word
zle -N incremental-complete-word
bindkey -M vicmd / incremental-complete-word
zstyle ':completion:incremental:*' completer _history
However, I haven't tried it; you may need other zstyles, and I don't
know how compatible incremental-complete-word is with vi-mode.
} 10:56 < glphvgacs> ft: hi, while user isearches in vicmd mode; is it
} possible to hit some key (tab?) to run through the possible hits
} (something like menu-completion)?
} 11:22 < glphvgacs> a key for reapeating bck-i-search that is not
} emac-style i.e. '^r'
} 11:24 < Mikachu> you can bind keys in the isearch keymap
} 11:24 < Mikachu> if that helps
} 11:27 < glphvgacs> Mikachu: I have this bindkey -M vicmd 'f'
} history-incremental-search-backward
} 11:27 < Mikachu> obviously you can't use f in isearch since i assume
} you want to be able to type f
} 11:27 < glphvgacs> but that's just to start isearch
} 11:27 < Mikachu> but you could try bindkey -M isearch '^I'
} history-incremental-search-backward
} 11:32 < glphvgacs> vimperator guys have a nice feature to open a
} location; user hits 'o' and starts typing then user gets a list of
} possible completions and then (here is the good part) user can <tab>
} through the results. i don't think i can search for <tab> in my search
} history so having that key doing nothing during bck-search and then
} introducing an extra key to hold (in the case of '^r' or as you
} suggested '^I') seems redundant, i think
} 11:34 < glphvgacs> i mean then whole idea of going vicmd to me at
} least to to get rid of that extra '^' in emacs, to thing vi as opposed
} to emacs, right?
} 11:34 < Mikachu> ^I is tab
} 11:34 -!- bapt is now known as aigrbapt
} 11:34 < glphvgacs> nice
} 11:34 < Mikachu> it took me a while to realize that isn't immediately
} obvious to everyone
} 11:36 < glphvgacs> so empty line + ^I brings up bck-search
} 11:36 < glphvgacs> i was thinking I as in Increment
} 11:36 < glphvgacs> thnx
} 11:36 < Mikachu> after going into the searhc mode, pressing tab should
} be the same as pressing ctrl-r again in emacs mode
} 11:37 * Mikachu disappears
} 11:37 < glphvgacs> yeah, not really
} 11:38 < glphvgacs> it doesn't do what i wanted but still a nice touch
--
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: bck-search in vicmd is not thinking vi-style
2010-04-07 16:43 ` Bart Schaefer
@ 2010-04-07 18:21 ` Maryam
0 siblings, 0 replies; 7+ messages in thread
From: Maryam @ 2010-04-07 18:21 UTC (permalink / raw)
To: Bart Schaefer; +Cc: zsh-users
On Wed, Apr 7, 2010 at 12:43 PM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
> On Apr 7, 11:55am, Maryam wrote:
> }
> } Can someone help me figure this out? thnx.
>
> Figure out which part? There's a whole conversation there ...
here is the question: if user starts a bck-search for a string that
has more that one incident in his history bck-search will put up the
last incident that that string was part of an issued command, now if
user wants to see more he hits '^r' and that causes the cycles
bck-search to cycle through the older incidents of that string in
zsh_history.
the question is, is it possible to change the bound key, namely '^r',
to something else?
in emacs-style '^r' invokes the bck-search and also cycles through
older results. user can, at least in vicmd mode, change the bck-search
invoking key from '^r' to something else, say '^I', and that suggests
that one should be able to change the "cycling" boundkey as well.
menu-completion was just as extra feature request so that user would
see if there is any point in going through older hits.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: bck-search in vicmd is not thinking vi-style
2010-04-07 15:55 bck-search in vicmd is not thinking vi-style Maryam
2010-04-07 16:43 ` Bart Schaefer
@ 2010-04-08 9:35 ` Thor Andreassen
2010-04-08 20:12 ` Maryam
1 sibling, 1 reply; 7+ messages in thread
From: Thor Andreassen @ 2010-04-08 9:35 UTC (permalink / raw)
To: zsh-users
On Wed, Apr 07, 2010 at 11:55:17AM -0400, Maryam wrote:
> 10:56 < glphvgacs> ft: hi, while user isearches in vicmd mode; is it
> possible to hit some key (tab?) to run through the possible hits
> (something like menu-completion)?
> 11:22 < glphvgacs> a key for reapeating bck-i-search that is not
> emac-style i.e. '^r'
> 11:24 < Mikachu> you can bind keys in the isearch keymap
> 11:24 < Mikachu> if that helps
> 11:27 < glphvgacs> Mikachu: I have this bindkey -M vicmd 'f'
> history-incremental-search-backward
> 11:27 < Mikachu> obviously you can't use f in isearch since i assume
> you want to be able to type f
> 11:27 < glphvgacs> but that's just to start isearch
> 11:27 < Mikachu> but you could try bindkey -M isearch '^I'
> history-incremental-search-backward
> 11:32 < glphvgacs> vimperator guys have a nice feature to open a
> location; user hits 'o' and starts typing then user gets a list of
> possible completions and then (here is the good part) user can <tab>
> through the results. i don't think i can search for <tab> in my search
> history so having that key doing nothing during bck-search and then
> introducing an extra key to hold (in the case of '^r' or as you
> suggested '^I') seems redundant, i think
> 11:34 < glphvgacs> i mean then whole idea of going vicmd to me at
> least to to get rid of that extra '^' in emacs, to thing vi as opposed
> to emacs, right?
> 11:34 < Mikachu> ^I is tab
> 11:34 -!- bapt is now known as aigrbapt
> 11:34 < glphvgacs> nice
> 11:34 < Mikachu> it took me a while to realize that isn't immediately
> obvious to everyone
> 11:36 < glphvgacs> so empty line + ^I brings up bck-search
> 11:36 < glphvgacs> i was thinking I as in Increment
> 11:36 < glphvgacs> thnx
> 11:36 < Mikachu> after going into the searhc mode, pressing tab should
> be the same as pressing ctrl-r again in emacs mode
> 11:37 * Mikachu disappears
> 11:37 < glphvgacs> yeah, not really
> 11:38 < glphvgacs> it doesn't do what i wanted but still a nice touch
>
> Can someone help me figure this out? thnx.
Doing:
bindkey -M vicmd "f" history-incremental-search-backward
bindkey -M isearch "^I" history-incremental-search-backward
Seems to do what you want.
--
best regards
Thor Andreassen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: bck-search in vicmd is not thinking vi-style
2010-04-08 9:35 ` Thor Andreassen
@ 2010-04-08 20:12 ` Maryam
2010-04-08 20:22 ` Mikael Magnusson
0 siblings, 1 reply; 7+ messages in thread
From: Maryam @ 2010-04-08 20:12 UTC (permalink / raw)
To: zsh-users
On Thu, Apr 8, 2010 at 5:35 AM, Thor Andreassen <ta@toggle.be> wrote:
> On Wed, Apr 07, 2010 at 11:55:17AM -0400, Maryam wrote:
>> 10:56 < glphvgacs> ft: hi, while user isearches in vicmd mode; is it
>> possible to hit some key (tab?) to run through the possible hits
>> (something like menu-completion)?
>> 11:22 < glphvgacs> a key for reapeating bck-i-search that is not
>> emac-style i.e. '^r'
>> 11:24 < Mikachu> you can bind keys in the isearch keymap
>> 11:24 < Mikachu> if that helps
>> 11:27 < glphvgacs> Mikachu: I have this bindkey -M vicmd 'f'
>> history-incremental-search-backward
>> 11:27 < Mikachu> obviously you can't use f in isearch since i assume
>> you want to be able to type f
>> 11:27 < glphvgacs> but that's just to start isearch
>> 11:27 < Mikachu> but you could try bindkey -M isearch '^I'
>> history-incremental-search-backward
>> 11:32 < glphvgacs> vimperator guys have a nice feature to open a
>> location; user hits 'o' and starts typing then user gets a list of
>> possible completions and then (here is the good part) user can <tab>
>> through the results. i don't think i can search for <tab> in my search
>> history so having that key doing nothing during bck-search and then
>> introducing an extra key to hold (in the case of '^r' or as you
>> suggested '^I') seems redundant, i think
>> 11:34 < glphvgacs> i mean then whole idea of going vicmd to me at
>> least to to get rid of that extra '^' in emacs, to thing vi as opposed
>> to emacs, right?
>> 11:34 < Mikachu> ^I is tab
>> 11:34 -!- bapt is now known as aigrbapt
>> 11:34 < glphvgacs> nice
>> 11:34 < Mikachu> it took me a while to realize that isn't immediately
>> obvious to everyone
>> 11:36 < glphvgacs> so empty line + ^I brings up bck-search
>> 11:36 < glphvgacs> i was thinking I as in Increment
>> 11:36 < glphvgacs> thnx
>> 11:36 < Mikachu> after going into the searhc mode, pressing tab should
>> be the same as pressing ctrl-r again in emacs mode
>> 11:37 * Mikachu disappears
>> 11:37 < glphvgacs> yeah, not really
>> 11:38 < glphvgacs> it doesn't do what i wanted but still a nice touch
>>
>> Can someone help me figure this out? thnx.
>
> Doing:
>
> bindkey -M vicmd "f" history-incremental-search-backward
> bindkey -M isearch "^I" history-incremental-search-backward
it does indeed; thnx.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: bck-search in vicmd is not thinking vi-style
2010-04-08 20:12 ` Maryam
@ 2010-04-08 20:22 ` Mikael Magnusson
2010-04-09 13:26 ` Maryam
0 siblings, 1 reply; 7+ messages in thread
From: Mikael Magnusson @ 2010-04-08 20:22 UTC (permalink / raw)
To: Maryam; +Cc: zsh-users
On 8 April 2010 22:12, Maryam <darwinskernel@gmail.com> wrote:
> On Thu, Apr 8, 2010 at 5:35 AM, Thor Andreassen <ta@toggle.be> wrote:
>> On Wed, Apr 07, 2010 at 11:55:17AM -0400, Maryam wrote:
>>> 10:56 < glphvgacs> ft: hi, while user isearches in vicmd mode; is it
>>> possible to hit some key (tab?) to run through the possible hits
>>> (something like menu-completion)?
>>> 11:22 < glphvgacs> a key for reapeating bck-i-search that is not
>>> emac-style i.e. '^r'
>>> 11:24 < Mikachu> you can bind keys in the isearch keymap
>>> 11:24 < Mikachu> if that helps
>>> 11:27 < glphvgacs> Mikachu: I have this bindkey -M vicmd 'f'
>>> history-incremental-search-backward
>>> 11:27 < Mikachu> obviously you can't use f in isearch since i assume
>>> you want to be able to type f
>>> 11:27 < glphvgacs> but that's just to start isearch
>>> 11:27 < Mikachu> but you could try bindkey -M isearch '^I'
>>> history-incremental-search-backward
>>> 11:32 < glphvgacs> vimperator guys have a nice feature to open a
>>> location; user hits 'o' and starts typing then user gets a list of
>>> possible completions and then (here is the good part) user can <tab>
>>> through the results. i don't think i can search for <tab> in my search
>>> history so having that key doing nothing during bck-search and then
>>> introducing an extra key to hold (in the case of '^r' or as you
>>> suggested '^I') seems redundant, i think
>>> 11:34 < glphvgacs> i mean then whole idea of going vicmd to me at
>>> least to to get rid of that extra '^' in emacs, to thing vi as opposed
>>> to emacs, right?
>>> 11:34 < Mikachu> ^I is tab
>>> 11:34 -!- bapt is now known as aigrbapt
>>> 11:34 < glphvgacs> nice
>>> 11:34 < Mikachu> it took me a while to realize that isn't immediately
>>> obvious to everyone
>>> 11:36 < glphvgacs> so empty line + ^I brings up bck-search
>>> 11:36 < glphvgacs> i was thinking I as in Increment
>>> 11:36 < glphvgacs> thnx
>>> 11:36 < Mikachu> after going into the searhc mode, pressing tab should
>>> be the same as pressing ctrl-r again in emacs mode
>>> 11:37 * Mikachu disappears
>>> 11:37 < glphvgacs> yeah, not really
>>> 11:38 < glphvgacs> it doesn't do what i wanted but still a nice touch
>>>
>>> Can someone help me figure this out? thnx.
>>
>> Doing:
>>
>> bindkey -M vicmd "f" history-incremental-search-backward
>> bindkey -M isearch "^I" history-incremental-search-backward
>
> it does indeed; thnx.
Isn't this precisely what I suggested in our irc conversation? :)
--
Mikael Magnusson
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: bck-search in vicmd is not thinking vi-style
2010-04-08 20:22 ` Mikael Magnusson
@ 2010-04-09 13:26 ` Maryam
0 siblings, 0 replies; 7+ messages in thread
From: Maryam @ 2010-04-09 13:26 UTC (permalink / raw)
To: Mikael Magnusson; +Cc: zsh-users
> Isn't this precisely what I suggested in our irc conversation? :)
>
> --
> Mikael Magnusson
>
true but it didn't occur to me that i needed both of the lines.
remember i'm new to this.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-04-09 13:26 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-07 15:55 bck-search in vicmd is not thinking vi-style Maryam
2010-04-07 16:43 ` Bart Schaefer
2010-04-07 18:21 ` Maryam
2010-04-08 9:35 ` Thor Andreassen
2010-04-08 20:12 ` Maryam
2010-04-08 20:22 ` Mikael Magnusson
2010-04-09 13:26 ` Maryam
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).