diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-08-04 23:53:11 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-08-04 23:53:11 -0400 |
commit | 4dc4efc36fad058298d69d4b2533beded3293c33 (patch) | |
tree | e5901ccb3b487097882c4293312a825c8fbd305d /runtime/doc | |
parent | a8e973dea6871ccce4a86a104bfbed05ad671e5e (diff) | |
parent | 66ceb5a487eff0b856142b41ce0a95d3b1ea85e5 (diff) | |
download | rneovim-4dc4efc36fad058298d69d4b2533beded3293c33.tar.gz rneovim-4dc4efc36fad058298d69d4b2533beded3293c33.tar.bz2 rneovim-4dc4efc36fad058298d69d4b2533beded3293c33.zip |
Merge #4449 'man.vim'
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/filetype.txt | 51 | ||||
-rw-r--r-- | runtime/doc/usr_12.txt | 19 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 1 |
3 files changed, 32 insertions, 39 deletions
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 76aa3a50ce..92ed9de369 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -500,7 +500,7 @@ Options: avoid that a Subject line with "Vim:" in it will cause an error message. 'textwidth' is set to 72. This is often recommended for e-mail. -'formatoptions' is set to break text lines and to repeat the comment leader +'formatoptions' is set to break text lines and to repeat the comment leader in new lines, so that a leading ">" for quotes is repeated. You can also format quoted text with |gq|. @@ -512,37 +512,40 @@ Local mappings: MAN *ft-man-plugin* *:Man* *man.vim* -Displays a manual page in a nice way. Also see the user manual -|find-manpage|. +View manpages in Nvim. Supports highlighting, autocompletion, locales, and +navigation. See also |find-manpage|. -To start using the ":Man" command before any manual page was loaded, source -this script from your startup vimrc file: > +To use Nvim as a manpager: - runtime ftplugin/man.vim - -Options: -'iskeyword' the '.' character is added to be able to use CTRL-] on the - manual page name. + export MANPAGER="nvim -c 'set ft=man' -" Commands: -Man {name} Display the manual page for {name} in a window. -Man {number} {name} - Display the manual page for {name} in a section {number}. - -Global mapping: -<Leader>K Displays the manual page for the word under the cursor. +Man {name} Display the manpage for {name} in a window. +Man {sect} {name} Display the manpage for {name} and section {sect}. +Man {name}({sect}) Alternate syntax which auto-completes the section. +Man {sect} {name}({sect}) Used during completion to show the real section of + when the provided section is a prefix, e.g. 1m vs 1. +Man {path} Open the manpage specified by path. Use "./" if it + is in the current directory. + +Global Mappings: +<Plug>(Man) Jump to the manpage for the <cWORD> under the + cursor in a new tab. Takes a count for the section. Local mappings: -CTRL-] Jump to the manual page for the word under the cursor. -CTRL-T Jump back to the previous manual page. -q Same as ":quit" +K +CTRL-] Jump to the manpage for the <cWORD> under the + cursor. Takes a count for the section. +CTRL-T Jump back to the previous manpage. +q Close the window. -To enable folding use this: > - let g:ft_man_folding_enable = 1 -If you do not like the default folding, use an autocommand to add your desired -folding style instead. For example: > - autocmd FileType man setlocal foldmethod=indent foldenable +Variables: +g:no_man_maps Do not create mappings in manpage buffers. +g:ft_man_folding_enable Fold manpages with foldmethod=indent foldnestmax=1. +If you do not like the default folding, use an autocommand to add your desired +folding style instead. For example: > + :autocmd FileType man setlocal foldmethod=indent foldenable PDF *ft-pdf-plugin* diff --git a/runtime/doc/usr_12.txt b/runtime/doc/usr_12.txt index 237abae55f..169d886e78 100644 --- a/runtime/doc/usr_12.txt +++ b/runtime/doc/usr_12.txt @@ -237,19 +237,8 @@ simple way: Move the cursor to the word you want to find help on and press > K -Vim will run the external "man" program on the word. If the man page is -found, it is displayed. This uses the normal pager to scroll through the text -(mostly the "more" program). When you get to the end pressing <Enter> will -get you back into Vim. - -A disadvantage is that you can't see the man page and the text you are working -on at the same time. There is a trick to make the man page appear in a Vim -window. First, load the man filetype plugin: > - - :runtime! ftplugin/man.vim - -Put this command in your vimrc file if you intend to do this often. Now you -can use the ":Man" command to open a window on a man page: > +Nvim will run |:Man| on the word. If the man page is found, it is displayed. +You can also use the |:Man| command to open a window on a man page: > :Man csh @@ -267,7 +256,7 @@ window. To display a man page for the word under the cursor, use this: > - \K + K (If you redefined the <Leader>, use it instead of the backslash). For example, you want to know the return value of "strstr()" while editing @@ -275,7 +264,7 @@ this line: if ( strstr (input, "aap") == ) ~ -Move the cursor to somewhere on "strstr" and type "\K". A window will open +Move the cursor to somewhere on "strstr" and type "K". A window will open to display the man page for strstr(). ============================================================================== diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 937ed9e8ba..47380428b0 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -96,6 +96,7 @@ Options: Commands: |:CheckHealth| + |:Man| has many improvements, including auto-completion Functions: |execute()| works with |:redir| |