summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorDan Reif <dan.reif@collectivehealth.com>2018-04-16 11:31:57 -0700
committerDan Reif <dan.reif@collectivehealth.com>2018-04-16 11:31:57 -0700
commit98f90bced5ff053f3e2546175ffc3ecb72f561f9 (patch)
tree4f303ee7aa14e8b169089f7bf196586374d29ec9 /build
parentcab6866e21341cab7419cdb4ae1fd18437d31bb0 (diff)
downloadvim-polyglot-98f90bced5ff053f3e2546175ffc3ecb72f561f9.tar.gz
vim-polyglot-98f90bced5ff053f3e2546175ffc3ecb72f561f9.zip
Allow disabling of individual ftdetect rules via g:polyglot_disabled
Diffstat (limited to 'build')
-rwxr-xr-xbuild18
1 files changed, 10 insertions, 8 deletions
diff --git a/build b/build
index 42a121db..3ba0f711 100755
--- a/build
+++ b/build
@@ -59,14 +59,16 @@ extract() {
continue
fi
- for f in ${dir}/ftdetect/*; do
- (
- echo "augroup filetypedetect";
- echo '" '"$pack";
- cat "${f}";
- echo "augroup END";
- echo
- ) >> tmp/polyglot.vim;
+ for f in "${dir}/ftdetect/"*; do
+ cat <<EOF >> tmp/polyglot.vim
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '${pack%%:*}') == -1
+ augroup filetypedetect
+ " ${pack%%:*}, from ${f##*/ftdetect/} in ${pack#*:}
+$(cat "${f}")
+ augroup end
+endif
+
+EOF
done
done