Sunday, September 13, 2015

Re: How to use :help?

On Sun, Sep 13, 2015 at 1:02 PM, glts <676c7473@gmail.com> wrote:
> On Sunday, September 13, 2015 at 12:04:09 PM UTC+2, Niels Kobschätzki wrote:
>> I read quite often "just use the help" or recently on the list "don't
>> use google, use :help". But how do I "use" it? When I want to know if
>> something is possible in vim, I never figured out how to search for it
>> because I always got the feeling that I need at least to know what
>> something is called to be able to find it in the first place in the
>> help.
>>
>> For example digraphs. I didn't know that this function exists. I read
>> about it in "Practical Vim" by Drew Neil (btw best vim-book out there
>> imho) and then I could use ":help digraphs" to find the characters I
>> need. But before that I relied on copy and paste from character tables
>> and stuff like that. How could I have found out about digraphs with the
>> help-function without knowing that they exist? ":help special
>> characters" doesn't find anything, also ":help insert special
>> characters". And this is just one example. Other examples would include
>> the .-command, gq to break lines anew to fit the set character width, or
>> showcmd (:h show command or :h showcommand won't find anything, only :h
>> showcmd). But there is certainly more.
>
> Read ':h help-summary' for an overview of what the :help command can do.
>
> My method for looking for help on an unknown topic is typing
>
> :h word
>
> followed by CTRL-D. This pops up a listing of topics containing "word".
> I glance over the listing until I find an entry that looks promising,
> else I'll try another "word" plus CTRL-D.
>
> Cheers,
>
>
> --
> David

Yes, and in addition, read the whole of the helphelp.txt file (":h
helphelp" or ":h helphelp.txt"). It explains in detail the various
ways to get help. Here are a few examples:

:help blabla<Ctrl-D>
list all help subjects containing the string "blabla"

With +wildmenu compiled-in and 'wildmenu' set to TRUE,
:help blabla<Tab>
gives you on the status line a menu of those same help subjects. Left
and right arrows navigate the menu, <Enter> accepts, <Esc> cancels.
Fine control with the 'wildmode' option.

With +quickfix compiled-in,
:helpgrep pattern
searches the whole help for anything matching the given pattern (which
is given as a search pattern, but not between slashes).

For use with :helpgrep (and with any quickfix commands), I recommend
the following mappings; vary the {lhs} to taste:
:map <F5> :cnext<CR>
:imap <F5> <C-O>:cnext<CR>
:map <S-F5> :cprev<CR>
:imap <S-F5> <C-O>:cprev<CR>
:map <F6> :cnfile<CR>
:imap <F6> <C-O>:cnfile<CR>
:map <S-F6> :cpfile<CR>
:imap <S-F6> <C-O>:cpfile<CR>
and maybe, if you don't need the keys for mappings you use more often,
:map <F7> :cfirst<CR>
:imap <F7> <C-O>:cfirst<CR>
:map <S-F7> :clast<CR>
:imap <S-F7> <C-O>:clast<CR>
The reversal of direction of these last two is in order to always use
the unshifted key for the more used command.

These mappings are explained in
:help map.txt
:help keycodes
:help quickfix.txt
:help i_CTRL-O


Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment