diff options
author | Jesse Luehrs <doy@tozt.net> | 2017-10-29 01:54:41 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2017-10-29 02:01:52 -0400 |
commit | fa3b083016391c7ced5074f498c942ab47034975 (patch) | |
tree | 0a10e329a6d247016d4391c875def483da895d47 /vimrc | |
parent | 34d83456f8c76ecdce5eb53abe6764c5ae061d64 (diff) | |
download | conf-fa3b083016391c7ced5074f498c942ab47034975.tar.gz conf-fa3b083016391c7ced5074f498c942ab47034975.zip |
more vim scoping
this fixes, at least, using the Help function directly before opening
denite for the first time (since `modifiable` was leaking through)
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -433,17 +433,20 @@ function! Help(visual, iskeyword, command) let l:word = expand('<cword>') endif let &iskeyword = l:iskeyword - exe &helpheight . 'new' - set modifiable + + exe 'noswapfile ' . &helpheight . 'new ' . l:word + setlocal buftype=nofile + setlocal bufhidden=wipe + setlocal nobuflisted + + setlocal modifiable exe 'call ' . a:command . '("' . l:word . '")' normal! ggdd - set buftype=nofile - set nobuflisted - set nomodifiable + setlocal nomodifiable endfunction function! s:man(word) exe 'silent read! man -Pcat ' . a:word - set filetype=man + setlocal filetype=man endfunction nnoremap <silent>K :call Help(0, [], '<SID>man')<CR> xnoremap <silent>K :call Help(1, [], '<SID>man')<CR> |