summaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-10-29 01:54:41 -0400
committerJesse Luehrs <doy@tozt.net>2017-10-29 02:01:52 -0400
commitfa3b083016391c7ced5074f498c942ab47034975 (patch)
tree0a10e329a6d247016d4391c875def483da895d47 /vimrc
parent34d83456f8c76ecdce5eb53abe6764c5ae061d64 (diff)
downloadconf-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--vimrc15
1 files changed, 9 insertions, 6 deletions
diff --git a/vimrc b/vimrc
index 6f8d7e7..06fbb8b 100644
--- a/vimrc
+++ b/vimrc
@@ -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>