Allow disabling individual language packs
This commit is contained in:
parent
4033ac02d0
commit
f977779693
@ -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)
|
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent, ftdetect)
|
||||||
- [css-color](https://github.com/ap/vim-css-color) (autoload, syntax)
|
- [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
|
## Contributing
|
||||||
|
|
||||||
Language packs are periodically updated using automated `build` script.
|
Language packs are periodically updated using automated `build` script.
|
||||||
|
6
build
6
build
@ -42,7 +42,7 @@ extract() {
|
|||||||
subdirs="$subdirs, $base"
|
subdirs="$subdirs, $base"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
copy_dir "${dir}${subtree}" "$subdir"
|
copy_dir "${dir}${subtree}" "$subdir" "$name"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -67,7 +67,9 @@ copy_dir() {
|
|||||||
file_path="$(dirname "${file##$1/}")"
|
file_path="$(dirname "${file##$1/}")"
|
||||||
mkdir -p "$file_path"
|
mkdir -p "$file_path"
|
||||||
touch "$file_path/$(basename "$file")"
|
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
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5
plugin_guard.vim.template
Normal file
5
plugin_guard.vim.template
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '%%PACK%%') == -1
|
||||||
|
|
||||||
|
%%CONTENT%%
|
||||||
|
|
||||||
|
endif
|
Loading…
x
Reference in New Issue
Block a user