aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/sh/han.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-17 01:01:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-17 01:01:12 +1200
commit37ae33b03cb8f7a0ea591c56fae48c5bcb588704 (patch)
tree2ddd07cd9dd348fa4f251d4b83960e24cf75d30f /vim/after/ftplugin/sh/han.vim
parentMerge branch 'release/v0.53.0' (diff)
parentRegenerate dotfiles(7) manual (diff)
downloaddotfiles-37ae33b03cb8f7a0ea591c56fae48c5bcb588704.tar.gz
dotfiles-37ae33b03cb8f7a0ea591c56fae48c5bcb588704.zip
Merge branch 'release/v0.54.0'v0.54.0
* release/v0.54.0: Regenerate dotfiles(7) manual Bump VERSION Add note about compiler scripts Arrange for tidiers to hold window position Update markdown_autoformat.vim Update surround.vim Completely overhaul after/ftplugin files Use short-circuit for no-mapping check Correct g:current_compiler setting Consistently require 'nocompatible' for ftplugins Upgrade insert_suspend_hlsearch.vim Use `function!` consistently in ftplugins Fix comments in vim/filetype.vim Set 'comments' blank by default Add Xresources filenames Add more names to Vim Bash types
Diffstat (limited to 'vim/after/ftplugin/sh/han.vim')
-rw-r--r--vim/after/ftplugin/sh/han.vim26
1 files changed, 26 insertions, 0 deletions
diff --git a/vim/after/ftplugin/sh/han.vim b/vim/after/ftplugin/sh/han.vim
new file mode 100644
index 00000000..3aacdb7e
--- /dev/null
+++ b/vim/after/ftplugin/sh/han.vim
@@ -0,0 +1,26 @@
+" sh/han.vim: Use han(1df) as 'keywordprg' for Bash scripts
+
+" Don't load if running compatible or too old
+if &compatible || v:version < 700
+ finish
+endif
+
+" Don't load if already loaded
+if exists('b:did_ftplugin_sh_han')
+ finish
+endif
+
+" Don't load if this isn't Bash or if han(1df) isn't available
+if !exists('b:is_bash') || !executable('han')
+ finish
+endif
+
+" Flag as loaded
+let b:did_ftplugin_sh_han = 1
+let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|unlet b:did_ftplugin_sh_han'
+
+" Set 'keywordprg' to han(1df)
+setlocal keywordprg=han
+let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|setlocal keywordprg<'