diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/man.vim | 4 | ||||
-rw-r--r-- | runtime/ftplugin/man.vim | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index 4d6a1f78dc..065ca8432e 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -125,9 +125,7 @@ endfunction function! s:set_options(pager) abort setlocal noswapfile buftype=nofile bufhidden=hide setlocal nomodified readonly nomodifiable - if a:pager - nnoremap <silent> <buffer> <nowait> q :lclose<CR>:q<CR> - endif + let b:pager = a:pager setlocal filetype=man endfunction diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index fce12012b5..d7a08a9941 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -24,7 +24,11 @@ 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> - nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c + if get(b:, 'pager') + nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>q + else + nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c + endif endif if get(g:, 'ft_man_folding_enable', 0) |