- 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
This commit is contained in:
Anmol Sethi
2016-08-24 11:56:33 -04:00
committed by Justin M. Keyes
parent 94dfb6cea2
commit f8fc8f51c0
6 changed files with 80 additions and 91 deletions

View File

@@ -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!