From fa3b083016391c7ced5074f498c942ab47034975 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 29 Oct 2017 01:54:41 -0400 Subject: more vim scoping this fixes, at least, using the Help function directly before opening denite for the first time (since `modifiable` was leaking through) --- vimrc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'vimrc') 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('') 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 K :call Help(0, [], 'man') xnoremap K :call Help(1, [], 'man') -- cgit v1.2.3-54-g00ecf