neovim/runtime/plugin/man.vim
zeertzjq 6ff1e3fa1f
fix(man.vim): use -addr=other instead of -range=-1 #15172
-range=-1 requires the current file to have at least <count> lines, whereas -addr=other doesn't.

-addr=other also sets <count> to -1 by default when it is not specified, though this feature seems undocumented.
2021-08-26 04:36:31 -07:00

16 lines
429 B
VimL

" Maintainer: Anmol Sethi <hi@nhooyr.io>
if exists('g:loaded_man')
finish
endif
let g:loaded_man = 1
command! -bang -bar -addr=other -complete=customlist,man#complete -nargs=* Man
\ if <bang>0 | call man#init_pager() |
\ else | call man#open_page(<count>, <q-mods>, <f-args>) | endif
augroup man
autocmd!
autocmd BufReadCmd man://* call man#read_page(matchstr(expand('<amatch>'), 'man://\zs.*'))
augroup END