aboutsummaryrefslogtreecommitdiff
path: root/runtime/plugin
diff options
context:
space:
mode:
authorAnmol Sethi <anmol@aubble.com>2016-08-24 11:56:33 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-09-03 12:57:41 -0400
commitf8fc8f51c0db0137a696f65a8ba75c89c1012119 (patch)
treee5591214a8a28b5cd6dce41865e295260d2df734 /runtime/plugin
parent94dfb6cea24180592af5c495dd9e8abf61d5735f (diff)
downloadrneovim-f8fc8f51c0db0137a696f65a8ba75c89c1012119.tar.gz
rneovim-f8fc8f51c0db0137a696f65a8ba75c89c1012119.tar.bz2
rneovim-f8fc8f51c0db0137a696f65a8ba75c89c1012119.zip
man.vim #5249
- fix synopsis highlighting in other locales. Cannot always rely on the first line for the section in some locales; instead, use the file path and explicitly set b:man_sect to the actual section. - eliminate separate s:man_args function - simplify logic: do not reuse buffer content - introduce b:man_default_sects Fixes #5233 - introduce <Plug>(man_vsplit), <Plug>(man_tab) - simplify regexps
Diffstat (limited to 'runtime/plugin')
-rw-r--r--runtime/plugin/man.vim8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/plugin/man.vim b/runtime/plugin/man.vim
index f3fe7151ca..df457c2243 100644
--- a/runtime/plugin/man.vim
+++ b/runtime/plugin/man.vim
@@ -7,7 +7,13 @@ let g:loaded_man = 1
command! -range=0 -complete=customlist,man#complete -nargs=+ Man call man#open_page(v:count, v:count1, <q-mods>, <f-args>)
-nnoremap <silent> <Plug>(Man) :<C-U>call man#open_page(v:count, v:count1, '', &filetype ==# 'man' ? expand('<cWORD>') : expand('<cword>'))<CR>
+function! s:cword() abort
+ return &filetype ==# 'man' ? expand('<cWORD>') : expand('<cword>')
+endfunction
+
+nnoremap <silent> <Plug>(man) :<C-U>execute 'Man ' .<SID>cword()<CR>
+nnoremap <silent> <Plug>(man_vsplit) :<C-U>execute 'vertical Man '.<SID>cword()<CR>
+nnoremap <silent> <Plug>(man_tab) :<C-U>execute 'tab Man ' .<SID>cword()<CR>
augroup man
autocmd!