diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2021-08-26 02:50:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-26 02:50:30 -0700 |
commit | b6b12ea7c3f2a5ac18d92efc5e4ef814971dfdef (patch) | |
tree | f401bafad2d00913685666c762fcbc1cf2849679 /runtime/ftplugin | |
parent | 502a56867d4accf63c50363f40e333c36088233f (diff) | |
download | rneovim-b6b12ea7c3f2a5ac18d92efc5e4ef814971dfdef.tar.gz rneovim-b6b12ea7c3f2a5ac18d92efc5e4ef814971dfdef.tar.bz2 rneovim-b6b12ea7c3f2a5ac18d92efc5e4ef814971dfdef.zip |
fix(man.vim): filetype=man is too eager #15489
Problem:
"set filetype=man" assumes the user wants :Man features, this does extra
stuff like renaming the buffer as "man://".
Solution:
- old entrypoint was ":set filetype=man", but this is too presumptuous #15487
- make the entrypoints more explicit:
1. when the ":Man" command is run
2. when a "man://" buffer is opened
- remove the tricky b:man_sect checks in ftplugin/man.vim and syntax/man.vim
- MANPAGER is supported via ":Man!", as documented.
fixes #15487
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/man.vim | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index 5d3e00d033..fce12012b5 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -6,14 +6,6 @@ if exists('b:did_ftplugin') || &filetype !=# 'man' endif let b:did_ftplugin = 1 -let s:pager = !exists('b:man_sect') - -if s:pager - call man#init_pager() -endif - -setlocal noswapfile buftype=nofile bufhidden=hide -setlocal nomodified readonly nomodifiable setlocal noexpandtab tabstop=8 softtabstop=8 shiftwidth=8 setlocal wrap breakindent linebreak @@ -32,11 +24,7 @@ if !exists('g:no_plugin_maps') && !exists('g:no_man_maps') nnoremap <silent> <buffer> k gk nnoremap <silent> <buffer> gO :call man#show_toc()<CR> nnoremap <silent> <buffer> <2-LeftMouse> :Man<CR> - if s:pager - nnoremap <silent> <buffer> <nowait> q :lclose<CR>:q<CR> - else - nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c - endif + nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c endif if get(g:, 'ft_man_folding_enable', 0) |