man.vim (1357B)
1 " Maintainer: Anmol Sethi <hi@nhooyr.io> 2 " Previous Maintainer: SungHyun Nam <goweol@gmail.com> 3 4 if exists('b:did_ftplugin') || &filetype !=# 'man' 5 finish 6 endif 7 let b:did_ftplugin = 1 8 9 setlocal noexpandtab tabstop=8 softtabstop=8 shiftwidth=8 10 setlocal wrap breakindent linebreak 11 setlocal colorcolumn=0 nolist 12 13 " Parentheses and '-' for references like `git-ls-files(1)`; '@' for systemd 14 " pages; ':' for Perl and C++ pages. Here, I intentionally omit the locale 15 " specific characters matched by `@`. 16 setlocal iskeyword=@-@,:,a-z,A-Z,48-57,_,.,-,(,) 17 18 " man page content is likely preformatted for the terminal width, so 19 " narrowing display by any additional columns leads to Embarrassing Line Wrap 20 setlocal nonumber norelativenumber foldcolumn=0 signcolumn=auto 21 22 setlocal tagfunc=v:lua.require'man'.goto_tag 23 24 if !exists('g:no_plugin_maps') && !exists('g:no_man_maps') 25 nnoremap <silent> <buffer> j gj 26 nnoremap <silent> <buffer> k gk 27 nnoremap <silent> <buffer> gO :lua require'man'.show_toc()<CR> 28 nnoremap <silent> <buffer> <2-LeftMouse> :Man<CR> 29 nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>q 30 endif 31 32 if get(g:, 'ft_man_folding_enable', 0) 33 setlocal foldenable 34 setlocal foldmethod=indent 35 setlocal foldnestmax=1 36 else 37 setlocal nofoldenable 38 endif 39 40 let b:undo_ftplugin = '' 41 " vim: set sw=2: