summaryrefslogtreecommitdiffstats
path: root/vim
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-10-29 19:02:29 -0400
committerJesse Luehrs <doy@tozt.net>2017-10-29 19:03:53 -0400
commit8d16bf64b3fe328a38a7674de88d6d20c278976d (patch)
tree003a6a65134e01d19f892d0a1f77f5c2fbd43ac9 /vim
parentff1339a0150e94cfdf93b6f3385081e6d540e56e (diff)
downloadconf-8d16bf64b3fe328a38a7674de88d6d20c278976d.tar.gz
conf-8d16bf64b3fe328a38a7674de88d6d20c278976d.zip
a few more tweaks for xs files
Diffstat (limited to 'vim')
-rw-r--r--vim/ftplugin/xs.vim9
1 files changed, 9 insertions, 0 deletions
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 <buffer> <silent>K :call Help(0, [], '<SID>perldoc_or_man')<CR>
+vnoremap <buffer> <silent>K :call Help(1, [], '<SID>perldoc_or_man')<CR>