From 8d16bf64b3fe328a38a7674de88d6d20c278976d Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 29 Oct 2017 19:02:29 -0400 Subject: a few more tweaks for xs files --- vim/ftplugin/xs.vim | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vim') diff --git a/vim/ftplugin/xs.vim b/vim/ftplugin/xs.vim index be6cce2..8dc989f 100644 --- a/vim/ftplugin/xs.vim +++ b/vim/ftplugin/xs.vim @@ -1 +1,10 @@ setlocal cindent +setlocal cinoptions+=:0,l1,g0,(0,W1s + +" look up words in perldoc rather than man for K if they exist +function! s:perldoc_or_man(word) + exe 'silent read! perldoc -o PlainText -a "' . a:word . '" 2>/dev/null || man -Pcat ' . a:word + setlocal ft=man +endfunction +nnoremap K :call Help(0, [], 'perldoc_or_man') +vnoremap K :call Help(1, [], 'perldoc_or_man') -- cgit v1.2.3-54-g00ecf