Closed syyyr closed 2 years ago
Output of :verbose map q
Vim:
n q *@:q<CR>
Last set from /usr/share/vim/vim81/ftplugin/man.vim line 39
q * :q<CR>
Last set from ~/.local/share/nvim/site/pack/bundle/opt/vim-superman/plugin/superman.vim line 41
Neovim:
n q *@:lclose<CR><C-W>c
Last set from /usr/share/nvim/runtime/ftplugin/man.vim
q * :q<CR>
Last set from ~/.local/share/nvim/site/pack/bundle/opt/vim-superman/plugin/superman.vim
I have switched to using MANPAGER
, which removed the need for a man/vim plugin, so I'll be closing this PR. Feel free to use the code, if you want.
The mapping didn't seem to work for me, because another buffer-local mapping overrides it in vim's runtime files:
This is almost the same as my proposed change. However, in neovim, the command is more complicated and actually uses
:close
, which doesn't close the window if it's the last one and that is kind of annoying, if you don't want to continue using vim after reading the man page. On the other hand, if you don't intent to support neovim, this line might as well be deleted, because it does nothing (the buffer-local mapping takes precedence anyway).