summaryrefslogtreecommitdiffstats
path: root/vim/.vim/ftplugin/xs.vim
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2023-10-08 12:09:20 -0400
committerJesse Luehrs <doy@tozt.net>2023-10-08 12:59:10 -0400
commit49570c8dd03448240897b37b68567352b790f16f (patch)
tree6c192a52046d5d0dd1b84a838befd8e777cfeafb /vim/.vim/ftplugin/xs.vim
parent66939c71da756c1d9e07a88a4a8ea2a018650060 (diff)
downloadconf-49570c8dd03448240897b37b68567352b790f16f.tar.gz
conf-49570c8dd03448240897b37b68567352b790f16f.zip
convert to stow
Diffstat (limited to 'vim/.vim/ftplugin/xs.vim')
-rw-r--r--vim/.vim/ftplugin/xs.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/vim/.vim/ftplugin/xs.vim b/vim/.vim/ftplugin/xs.vim
new file mode 100644
index 0000000..8dc989f
--- /dev/null
+++ b/vim/.vim/ftplugin/xs.vim
@@ -0,0 +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>