i am new to this group, let me know if feature requests should be discussed somewhere else.
Here is feature for which i couldn't find a plugin with google, but which looks so natural to me that i think it should be included somehow.
When searching (with "/") and a partial match is highlighted, and the first partial match is a part of the string one is looking for, it would be nice if instead of typing the rest of the search string, one could simply hit the right arrow a number of times to simultaneously extend the highlighted match and complete the search string.
Thanks,
Alexey.
You are looking for CTRL-L
It's already there :-)
--
Andy
And here are some mappings to use the arrow keys for the same purpose:
:cmap <expr> <Right> getcmdtype() =~ '[/?]' ? '<C-l>' : '<Right>'
:cmap <expr> <Left> getcmdtype() =~ '[/?]' ? '<BS>' : '<Left>'
:help :cmap
:help :map-<expr>
:help getcmdtype()
--
Best,
Ben
Thanks a lot, i should have googled better.
Alexey.
...and how would one find that? ':he ^L' just goes to the :redraw help
and the ':he /' section doesn't appear to talk about 'ctrl-l'.
The help is implemented with tags, and I've often wondered why ':tn'
doesn't do the obvious thing and take you to the next related help
topic. In this case cycling through ':redraw', <search's ctrl-l help>,
<whatever>, etc.
...Stu, vim user for 20 years, but still learning...
If you use
:tag /CTRL-L
you can then use :tn to jump to all the different matchting tags.
regards,
Christian
The very first help page
:help
is a must-read. It says, to find a cmdline-specific key, prepend "c_":
:h c_^L
or
:h c_CTRL-L
> The help is implemented with tags, and I've often wondered why ':tn'
> doesn't do the obvious thing and take you to the next related help
> topic. In this case cycling through ':redraw',<search's ctrl-l help>,
> <whatever>, etc.
>
> ...Stu, vim user for 20 years, but still learning...
Maybe because this idea isn't so obvious for other people?
At least there is a todo item (without priority):
:h todo|/^Help
Help:
- When a help item has multiple matches make it possible to use ":tn" to go
to the other matches.
--
Andy
Yes, when you have a tags file. That does not work in the help system,
which is what I was asking about. On second thought, I suppose my
actual question is, why doesn't the help contain a pre-built tags
file? On third thought, perhaps because what I'm asking for is more of
an index operation, which is a looser association that a series of
tags is normally.
Also, ':he /^L' gives 'E149: Sorry, no help...'
My question stands, how would a user find out about ctrl-l within the
/ operator? (For the record, this appears to be answered elsethread.)
...Stu
So there's a cross-reference missing between ':he /' and ':he incs'.
How about this update:
While typing the search pattern the current match will be shown if the
'incsearch' option is on. 'incsearch' also includes commands to
auto-complete the search pattern. Remember that you still have to
finish the search command with <CR> to actually position the cursor at
the displayed match. Or use <Esc> to abandon the search.
...Stu
Ah, thanks. I haven't read the first page in... decades I guess. Even
so, it probably would not have occurred to me to use _commandline_
help to locate something about _searchmode_ behaviour, even thought
there is a cross-reference in there.
I guess my new method is to try the naive ':he <xyz>' first, then try
each of the c_, i_, etc next. *Then* google.
> > The help is implemented with tags, and I've often wondered why ':tn'
> > doesn't do the obvious thing and take you to the next related help
> > topic. In this case cycling through ':redraw',<search's ctrl-l help>,
> > <whatever>, etc.
>
> Maybe because this idea isn't so obvious for other people?
:-) I guess it's obvious to tags users (programmers, largely).
Although, elsethread I came to the conclusion what I really want is
something more like an index, instead of strictly tags, which implies
a manually-built tags file. :-(
> At least there is a todo item (without priority):
>
> :h todo|/^Help
> Help:
> - When a help item has multiple matches make it possible to use ":tn"
> to go
> to the other matches.
Nifty! I have learned two things about vim today.
...Stu
On Mi, 15 Feb 2012, MacDonald, Stuart wrote:
> From: On Behalf Of Christian Brabandt
> > On Tue, February 14, 2012 14:53, MacDonald, Stuart wrote:
> > > ...and how would one find that? ':he ^L' just goes to the :redraw help
> > > and the ':he /' section doesn't appear to talk about 'ctrl-l'.
> > >
> > > The help is implemented with tags, and I've often wondered why ':tn'
> > > doesn't do the obvious thing and take you to the next related help
> > > topic. In this case cycling through ':redraw', <search's ctrl-l help>,
> > > <whatever>, etc.
> >
> > If you use
> > :tag /CTRL-L
> > you can then use :tn to jump to all the different matchting tags.
>
> Yes, when you have a tags file. That does not work in the help system,
> which is what I was asking about. On second thought, I suppose my
You didn't try it, right? Open the help and enter:
:tag /Ctrl-L
The third :tn will bring you to :h c_Ctrl-L
> actual question is, why doesn't the help contain a pre-built tags
> file? On third thought, perhaps because what I'm asking for is more of
There is a pre-built tags file for the help. Its $VIMRUNTIME/doc/tags
and can be updated with :helptags
> an index operation, which is a looser association that a series of
> tags is normally.
>
> Also, ':he /^L' gives 'E149: Sorry, no help...'
Don't use the literal ^L but type CTRL-L
> My question stands, how would a user find out about ctrl-l within the
> / operator? (For the record, this appears to be answered elsethread.)
Usually you prepend a letter plus a low dash for the mode, in which you
are interested, e.g. 'i_', if you need to find out a key-combination in
insert mode (e.g. :h i_CTRL-X_CTRL-F for insert mode completion) or 'c_'
for command mode, as in this case and as Andy already told you. And at
last, you can always :helpgrep for grepping inside the help files for
any search string.
regards,
Christian
Wrong. I came >< that close to replying to your original suggestion
with the same "didn't try it, right?" but figured I'd rather be sure.
So I tried several combinations, none of which worked...
> :tag /Ctrl-L
> The third :tn will bring you to :h c_Ctrl-L
...except I didn't try the one combination that does work: typing what
you said literally. ':tag /^L' doesn't work for instance. So yes, your
suggestion works but it uses the :tag command in a way I've never used
it before.
> There is a pre-built tags file for the help. Its $VIMRUNTIME/doc/tags
> and can be updated with :helptags
Nifty! Thanks.
> Usually you prepend a letter plus a low dash for the mode, in which you
> are interested, e.g. 'i_', if you need to find out a key-combination in
> insert mode (e.g. :h i_CTRL-X_CTRL-F for insert mode completion) or 'c_'
> for command mode, as in this case and as Andy already told you. And at
> last, you can always :helpgrep for grepping inside the help files for
> any search string.
Also didn't know about :helpgrep. Thanks!
...Stu