mirror of
https://github.com/neovim/neovim.git
synced 2026-01-06 19:39:53 +10:00
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
This commit is contained in:
committed by
Anmol Sethi (nhooyr)
parent
f665bde183
commit
e89eb5d21b
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user