Closed Konfekt closed 8 years ago
Turns out there is a built in Man command. The following snippet in .vimrc is a good built-in alternative to this manviewer:
Man
.vimrc
if !empty($MAN_PN) command! -nargs=0 MANPAGER call s:MANPAGER() fun! s:MANPAGER() bwipe! let page = expand('$MAN_PN') let page_pattern = '\v[a-zA-Z][0-9a-zA-Z-]+' let sec_pattern = '\v\(' . '((\d+(\+\d+|\w+)*)|(\w))' . '\)' let sec = substitute(matchstr(page, sec_pattern), '\v[()]', '', 'g') let page = substitute(page, sec_pattern, '', '') setlocal filetype=man exe 'Man ' sec . ' ' . page delcommand MANPAGER endf endif
It uses however <c-] and <c-t> for jumps. So
<c-]
<c-t>
nnoremap <nowait><buffer> q :quit<cr> nmap <nowait><buffer> <cr> <c-]> nmap <nowait><buffer> K <c-]> nmap <nowait><buffer> <s-tab> <c-t>
in ftplugin/man.vim may turn it more intuitive.
ftplugin/man.vim
?
Just for reference. Often Vim has already everything accumulated in his long history ut got forgotten. See ftplugin/man.vim
it's written in README :-]
Ah, ok you got me confused by reimplementing the c-] map.
Turns out there is a built in
Man
command. The following snippet in.vimrc
is a good built-in alternative to this manviewer:It uses however
<c-]
and<c-t>
for jumps. Soin
ftplugin/man.vim
may turn it more intuitive.