moll / vim-node

Tools and environment to make Vim superb for developing with Node.js. Like Rails.vim for Node.
http://www.vim.org/scripts/script.php?script_id=4674
Other
807 stars 59 forks source link

Support for other extensions #16

Closed danielfalk closed 9 years ago

danielfalk commented 9 years ago

With the coming of ES6, as well as server-side react, there are a few more extensions that it would be good if vim-node would recognize: .es, .es6, *.jsx

moll commented 9 years ago

Hey again!

I took a 6 hour nap during the night and came up with another approach to solving both your request and possibly others. How would you feel about the following and would you mind giving it a spin? :-)

In short, Vim has the 'suffixesadd' option to support arbitrary extension autocompletion. When initializing, Node.vim adds .js and .json, the only extensions Node.js supports by default, to that.

How about rather than extending the default list for everyone when it might only apply to some, we'll direct people just to add what they need to suffixesadd?

autocmd User Node setlocal suffixesadd+=.es,.es6,.jxs
danielfalk commented 9 years ago

That works. Guess the code change is not needed then.

moll commented 9 years ago

Superb. Thank you again! I'll reopen this if you don't mind just to remind me to add a note about this in the README!

moll commented 9 years ago

I ended up adding .es and .jsx to &suffixesadd anyways. :-)