Created
March 2, 2024 22:35
-
-
Save echo-64/1380d72061b7b6a31ddb5d5498f6ceda to your computer and use it in GitHub Desktop.
automatically activate/deactivate coc.nvim extensions ber filetype
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! ManageCocExtensions(extensionsToEnable) | |
| let installed = ['coc-html', 'coc-css', 'coc-tsserver', 'coc-html-css-support','coc-json', 'coc-emmet', 'coc-sh'] | |
| for extension in installed | |
| call CocActionAsync('deactivateExtension', extension) | |
| endfor | |
| for extension in a:extensionsToEnable | |
| call CocActionAsync('activeExtension', extension) | |
| endfor | |
| endfunction | |
| autocmd BufEnter *.html call ManageCocExtensions(['coc-html', 'coc-emmet', 'coc-html-css-support']) | |
| autocmd BufEnter *.css call ManageCocExtensions(['coc-css']) | |
| autocmd BufEnter *.js call ManageCocExtensions(['coc-tsserver']) | |
| autocmd BufEnter *.json call ManageCocExtensions(['coc-json']) | |
| autocmd BufEnter *.sh call ManageCocExtensions(['coc-sh']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment