diff options
author | Anmol Sethi <nhooyr@users.noreply.github.com> | 2016-09-03 21:53:58 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-09-04 03:53:58 +0200 |
commit | 9bba8ba372298d7cfac543085df6546e18d2c256 (patch) | |
tree | 6e5237bc0eb1f444f1016873a212c2e078e8038d /runtime/autoload | |
parent | 626065d385c4f7a06d2aa3dedf2fbb8fa68bfb48 (diff) | |
download | rneovim-9bba8ba372298d7cfac543085df6546e18d2c256.tar.gz rneovim-9bba8ba372298d7cfac543085df6546e18d2c256.tar.bz2 rneovim-9bba8ba372298d7cfac543085df6546e18d2c256.zip |
[RFC] man.vim: remove <Plug> mappings (#5290)
- :Man with no arguments opens the manapage for the
<cWORD> (man buffers) or <cword> (non-man buffers).
- remove now irrelevent comment about -P flag
Diffstat (limited to 'runtime/autoload')
-rw-r--r-- | runtime/autoload/man.vim | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index 20afbb8b43..bd8062f2b3 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -9,8 +9,7 @@ endif let s:man_find_arg = "-w" " TODO(nhooyr) Completion may work on SunOS; I'm not sure if `man -l` displays -" the list of searched directories. I also do not think Solaris supports the -" '-P' flag used above and uses only $PAGER. +" the list of searched directories. try if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5' let s:man_find_arg = '-l' @@ -23,11 +22,13 @@ function! man#open_page(count, count1, mods, ...) abort if a:0 > 2 call s:error('too many arguments') return - elseif a:0 ==# 1 - if empty(a:1) + elseif a:0 == 0 + let ref = &filetype ==# 'man' ? expand('<cWORD>') : expand('<cword>') + if empty(ref) call s:error('no identifier under cursor') return endif + elseif a:0 ==# 1 let ref = a:1 else " Combine the name and sect into a manpage reference so that all |