aboutsummaryrefslogtreecommitdiff
path: root/runtime/plugin/man.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-08-07 16:55:20 -0400
committerGitHub <noreply@github.com>2016-08-07 16:55:20 -0400
commitb85bae4cac17258dcc73ad8a35a74a9c0935f2ed (patch)
tree6e4292b65922cb91688df78378da5567913ebf60 /runtime/plugin/man.vim
parent64013a5debe7ae92c8044dfd18faf8f8385dd66d (diff)
parente8a3477dc771f6e8f9fa0c8de6d2bdef76fabdc8 (diff)
downloadrneovim-b85bae4cac17258dcc73ad8a35a74a9c0935f2ed.tar.gz
rneovim-b85bae4cac17258dcc73ad8a35a74a9c0935f2ed.tar.bz2
rneovim-b85bae4cac17258dcc73ad8a35a74a9c0935f2ed.zip
Merge #5168 from nhooyr/man-rewrite
man.vim: default mapping and general improvements
Diffstat (limited to 'runtime/plugin/man.vim')
-rw-r--r--runtime/plugin/man.vim9
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/plugin/man.vim b/runtime/plugin/man.vim
index c47459a551..12762f1854 100644
--- a/runtime/plugin/man.vim
+++ b/runtime/plugin/man.vim
@@ -5,6 +5,11 @@ if exists('g:loaded_man')
endif
let g:loaded_man = 1
-command! -complete=customlist,man#complete -nargs=* Man call man#open_page_command(<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, 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.*'))
+augroup END