summaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
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>