From f665bde183b5f44d82bd4cb66e0241c242c34766 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Fri, 5 Aug 2016 00:04:48 -0400 Subject: man.vim: default K mapping - Also some small improvements in other parts. --- runtime/plugin/man.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/man.vim b/runtime/plugin/man.vim index c47459a551..82ef154725 100644 --- a/runtime/plugin/man.vim +++ b/runtime/plugin/man.vim @@ -5,6 +5,6 @@ if exists('g:loaded_man') endif let g:loaded_man = 1 -command! -complete=customlist,man#complete -nargs=* Man call man#open_page_command() +command! -count=0 -complete=customlist,man#complete -nargs=* Man call man#open_page_command(v:count, v:count1, ) -nnoremap (Man) :call man#open_page_mapping(v:count, v:count1, expand('')) +nnoremap (Man) :call man#open_page_mapping(v:count, v:count1, &filetype ==# 'man' ? expand('') : expand('')) -- cgit From e89eb5d21bf4323bb690bc54d1f035bfd5d6b1e6 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sat, 6 Aug 2016 05:52:36 -0400 Subject: 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 --- runtime/plugin/man.vim | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'runtime/plugin') 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, ) +command! -count=0 -complete=customlist,man#complete -nargs=* Man call man#open_page(v:count, v:count1, ) -nnoremap (Man) :call man#open_page_mapping(v:count, v:count1, &filetype ==# 'man' ? expand('') : expand('')) +nnoremap (Man) :call man#open_page(v:count, v:count1, &filetype ==# 'man' ? expand('') : expand('')) + +augroup man + autocmd! + autocmd BufReadCmd man://* call man#read_page(matchstr(expand(''), '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 -- cgit From e8a3477dc771f6e8f9fa0c8de6d2bdef76fabdc8 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sat, 6 Aug 2016 16:04:34 -0400 Subject: man.vim: buffers are now listed - Since the names are set and ':vsplit printf(3)' work, there is no need to unlist them. --- runtime/plugin/man.vim | 4 ---- 1 file changed, 4 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/man.vim b/runtime/plugin/man.vim index b5b118fbe3..12762f1854 100644 --- a/runtime/plugin/man.vim +++ b/runtime/plugin/man.vim @@ -12,8 +12,4 @@ nnoremap (Man) :call man#open_page(v:count, v:count1, &filet augroup man autocmd! autocmd BufReadCmd man://* call man#read_page(matchstr(expand(''), '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 -- cgit