From f8fc8f51c0db0137a696f65a8ba75c89c1012119 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Wed, 24 Aug 2016 11:56:33 -0400 Subject: 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 (man_vsplit), (man_tab) - simplify regexps --- runtime/plugin/man.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runtime/plugin') 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, , ) -nnoremap (Man) :call man#open_page(v:count, v:count1, '', &filetype ==# 'man' ? expand('') : expand('')) +function! s:cword() abort + return &filetype ==# 'man' ? expand('') : expand('') +endfunction + +nnoremap (man) :execute 'Man ' .cword() +nnoremap (man_vsplit) :execute 'vertical Man '.cword() +nnoremap (man_tab) :execute 'tab Man ' .cword() augroup man autocmd! -- cgit