Allow disabling individual language packs

This commit is contained in:
John Guidry 2015-07-10 08:19:38 -05:00 committed by Adam Stankiewicz
parent 4033ac02d0
commit f977779693
3 changed files with 18 additions and 2 deletions

View File

@ -93,6 +93,15 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent, ftdetect)
- [css-color](https://github.com/ap/vim-css-color) (autoload, syntax)
## Disabling a language pack
Individual language packs can be disabled by setting `g:polyglot_disabled`.
```viml
" ~/.vimrc
let g:polyglot_disabled = ['css-color']
```
## Contributing
Language packs are periodically updated using automated `build` script.

6
build
View File

@ -42,7 +42,7 @@ extract() {
subdirs="$subdirs, $base"
fi
copy_dir "${dir}${subtree}" "$subdir"
copy_dir "${dir}${subtree}" "$subdir" "$name"
fi
done
@ -67,7 +67,9 @@ copy_dir() {
file_path="$(dirname "${file##$1/}")"
mkdir -p "$file_path"
touch "$file_path/$(basename "$file")"
cat $file >> $file_path/$(basename "$file")
# Use comma instead of / to handle cases like c/c++
sed -e "s,%%PACK%%,$3," -e "/%%CONTENT%%/{r $file" -e "d;}" plugin_guard.vim.template >> $file_path/$(basename "$file")
done
}

View File

@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '%%PACK%%') == -1
%%CONTENT%%
endif