3

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?

Stevens Garcia
  • 147
  • 2
  • 10

2 Answers2

5

You can use an autocmd in your .vimrc:

autocmd FileType javascript UltiSnipsAddFiletypes javascript-node
tckmn
  • 57,719
  • 27
  • 114
  • 156
3

Just to add on to @tckmn 's answer, I used this for multiple filetypes, keeping in mind that UltiSnipsAddFiletypes uses . as a delimiter:

autocmd FileType javascript,javascriptreact,typescript,typescriptreact
  \ UltiSnipsAddFiletypes javascript.javascriptreact.typescript.typescriptreact

zzzachzzz
  • 81
  • 1
  • 4