diff options
author | Anmol Sethi <anmol@aubble.com> | 2016-08-06 05:52:36 -0400 |
---|---|---|
committer | Anmol Sethi (nhooyr) <anmol@aubble.com> | 2016-08-07 15:53:07 -0400 |
commit | e89eb5d21bf4323bb690bc54d1f035bfd5d6b1e6 (patch) | |
tree | b71be13c92409de03b15210160da553d72b288d2 /runtime/plugin/man.vim | |
parent | f665bde183b5f44d82bd4cb66e0241c242c34766 (diff) | |
download | rneovim-e89eb5d21bf4323bb690bc54d1f035bfd5d6b1e6.tar.gz rneovim-e89eb5d21bf4323bb690bc54d1f035bfd5d6b1e6.tar.bz2 rneovim-e89eb5d21bf4323bb690bc54d1f035bfd5d6b1e6.zip |
man.vim: refactoring and autocmd fix
- man#open_page_command and man#open_page_mapping are now a single
function
- New autocmd to fix #5172
Diffstat (limited to 'runtime/plugin/man.vim')
-rw-r--r-- | runtime/plugin/man.vim | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/runtime/plugin/man.vim b/runtime/plugin/man.vim index 82ef154725..b5b118fbe3 100644 --- a/runtime/plugin/man.vim +++ b/runtime/plugin/man.vim @@ -5,6 +5,15 @@ if exists('g:loaded_man') endif let g:loaded_man = 1 -command! -count=0 -complete=customlist,man#complete -nargs=* Man call man#open_page_command(v:count, v:count1, <f-args>) +command! -count=0 -complete=customlist,man#complete -nargs=* Man call man#open_page(v:count, v:count1, <f-args>) -nnoremap <silent> <Plug>(Man) :<C-U>call man#open_page_mapping(v:count, v:count1, &filetype ==# 'man' ? expand('<cWORD>') : expand('<cword>'))<CR> +nnoremap <silent> <Plug>(Man) :<C-U>call man#open_page(v:count, v:count1, &filetype ==# 'man' ? expand('<cWORD>') : expand('<cword>'))<CR> + +augroup man + autocmd! + autocmd BufReadCmd man://* call man#read_page(matchstr(expand('<amatch>'), 'man://\zs.*')) + " Need this because without it, if you do ':Man printf(3)' and then later, + " open a session that contains a buffer named 'man://printf(3)', the buffer + " will become listed. + autocmd BufEnter man://* set nobuflisted +augroup END |