aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-01-23 20:03:05 -0500
committerJustin M. Keyes <justinkz@gmail.com>2015-09-23 00:05:33 -0400
commit998d0ffc09d5c7358db62dc88c2e2b87622f60b5 (patch)
tree468730ac462d4990fd8a26e696c0290841f45177 /runtime
parent481049e0c91995dd48b7cc10f8fbb157258a5e26 (diff)
downloadrneovim-998d0ffc09d5c7358db62dc88c2e2b87622f60b5.tar.gz
rneovim-998d0ffc09d5c7358db62dc88c2e2b87622f60b5.tar.bz2
rneovim-998d0ffc09d5c7358db62dc88c2e2b87622f60b5.zip
'keywordprg': support ex commands
- new feature: if the first character of 'keywordprg' is ":", the command is invoked as a Vim ex-command prefixed with [count]. - change default 'keywordprg' to :Man
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/options.txt10
-rw-r--r--runtime/doc/various.txt19
-rw-r--r--runtime/ftplugin/man.vim2
3 files changed, 16 insertions, 15 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 410e116064..fc4d685cb2 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -3877,18 +3877,20 @@ A jump table for the options with a short description can be found at |Q_op|.
The 'keymodel' option is set by the |:behave| command.
*'keywordprg'* *'kp'*
-'keywordprg' 'kp' string (default "man" or "man -s", DOS: ":help")
+'keywordprg' 'kp' string (default ":Man", Windows: ":help")
global or local to buffer |global-local|
Program to use for the |K| command. Environment variables are
expanded |:set_env|. ":help" may be used to access the Vim internal
help. (Note that previously setting the global option to the empty
value did this, which is now deprecated.)
- When "man" is used, Vim will automatically translate a count for the
- "K" command to a section number. Also for "man -s", in which case the
- "-s" is removed when there is no count.
+ When the first character is ":", the command is invoked as a Vim
+ command prefixed with [count]. {Nvim}
+ When "man" or "man -s" is used, Vim will automatically translate
+ a [count] for the "K" command to a section number.
See |option-backslash| about including spaces and backslashes.
Example: >
:set keywordprg=man\ -s
+ :set keywordprg=:Man
< This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index 6b53b8e24f..3cc0e7c8ab 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -542,7 +542,7 @@ which it was defined is reported.
{not available when compiled without the |+eval| feature}
*K*
-K Run a program to lookup the keyword under the
+[count]K Run a program to lookup the keyword under the
cursor. The name of the program is given with the
'keywordprg' (kp) option (default is "man"). The
keyword is formed of letters, numbers and the
@@ -550,19 +550,18 @@ K Run a program to lookup the keyword under the
right of the cursor is used. The same can be done
with the command >
:!{program} {keyword}
-< There is an example of a program to use in the tools
- directory of Vim. It is called 'ref' and does a
- simple spelling check.
- Special cases:
+< Special cases:
+ - If 'keywordprg' begins with ":" it is invoked as
+ a Vim command with [count].
- If 'keywordprg' is empty, the ":help" command is
used. It's a good idea to include more characters
in 'iskeyword' then, to be able to find more help.
- - When 'keywordprg' is equal to "man", a count before
- "K" is inserted after the "man" command and before
- the keyword. For example, using "2K" while the
- cursor is on "mkdir", results in: >
+ - When 'keywordprg' is equal to "man", a [count]
+ before "K" is inserted after the "man" command and
+ before the keyword. For example, using "2K" while
+ the cursor is on "mkdir", results in: >
!man 2 mkdir
-< - When 'keywordprg' is equal to "man -s", a count
+< - When 'keywordprg' is equal to "man -s", a [count]
before "K" is inserted after the "-s". If there is
no count, the "-s" is removed.
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index 11b2b0a665..e907220d0a 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -120,7 +120,7 @@ func <SID>GetPage(...)
let sect = ""
endif
if s:FindPage(sect, page) == 0
- echo "\nCannot find a '".page."'."
+ echo "\nNo manual entry for '".page."'."
return
endif
exec "let s:man_tag_buf_".s:man_tag_depth." = ".bufnr("%")