tpope / vim-apathy

apathy.vim: Set the 'path' option for miscellaneous file types
180 stars 9 forks source link

Set filetype extensions for javascript even when node_modules is not found #12

Open SevereOverfl0w opened 5 years ago

SevereOverfl0w commented 5 years ago

This will allow gf on projects between files in the same project even when I haven't done npm install yet.

tpope commented 5 years ago

Hesitant to stomp on other use cases to solve an edge case. But maybe fall back to looking for package.json?

SevereOverfl0w commented 5 years ago

is the intention only to set .js to suffixesadd only when there's a node_modules folder? It seems like that's generally useful for js outside of nodejs, to me at least.

tpope commented 5 years ago

The intention is to only handle the Node case, and stay out of the way for other environments. For example, the Rails asset pipeline has a different set of extensions and its own //= require import syntax handled by rails.vim. Mind you, that's the only "other environment" I can name, and even Rails is starting to favor Yarn. I'd be open to a more aggressive compromise.