summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2021-01-01 16:54:03 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2021-01-01 16:54:03 +0100
commitd6678a1b35f7cb873a6a62c371dcadfc03c8ae0d (patch)
tree757044f506610be5439655862b0da9f186034eda
parent0626cc90a21dbd93806e431a4cff640d2d13c765 (diff)
downloadvim-polyglot-d6678a1b35f7cb873a6a62c371dcadfc03c8ae0d.tar.gz
vim-polyglot-d6678a1b35f7cb873a6a62c371dcadfc03c8ae0d.zip
Allow to disable ftdetect scripts, closes #657
-rw-r--r--README.md9
-rw-r--r--ftdetect/polyglot.vim4
2 files changed, 13 insertions, 0 deletions
diff --git a/README.md b/README.md
index 783893f9..61fc940c 100644
--- a/README.md
+++ b/README.md
@@ -247,6 +247,15 @@ Vim Polyglot includes vim-sensible plugin, which is usually necessary for editin
let g:polyglot_disabled = ['sensible']
```
+## No ftdetect
+
+If you want to use vim-polyglot plugins, but not ftdetect autocommands, the you can disable it as so:
+
+
+```vim
+let g:polyglot_disabled = ['ftdetect']
+```
+
## Contributing
Language packs are periodically updated using automated `scripts/build` script.
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim
index 85c933e3..45087f65 100644
--- a/ftdetect/polyglot.vim
+++ b/ftdetect/polyglot.vim
@@ -140,6 +140,8 @@ augroup filetypedetect
let s:cpo_save = &cpo
set cpo&vim
+if !has_key(g:polyglot_is_disabled, 'ftdetect')
+
" DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE
if !has_key(g:polyglot_is_disabled, 'jsonc')
@@ -2655,6 +2657,8 @@ endif
" DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE
+endif
+
func! s:Observe(fn)
let b:PolyglotObserve = function("polyglot#" . a:fn)
augroup polyglot-observer