javascriptvimcode-snippetsultisnips

How to load UltiSnips file types by default in JS files?


I know that doing :UltiSnipsAddFiletypes javascript-node in vim console works. But I need this load automatically whenever I open a javascript file. Regardless documentation, I understood that I should create a ftplugin/javascript.vim file and put :UltiSnipsAddFiletypes javascript-node in first line. The thing is those snippets are not loaded.

So, how can make this works please?


Solution

  • You can use an autocmd in your .vimrc:

    autocmd FileType javascript UltiSnipsAddFiletypes javascript-node