styled-components / vim-styled-components

Vim bundle for http://styled-components.com based javascript files.
300 stars 24 forks source link

Only load in files that contain styled components #59

Closed snoblenet closed 5 years ago

snoblenet commented 5 years ago

Is there some way to make this only load in files that actually import the styled components module?

Or at least only to .jsx files?

fleischie commented 5 years ago

Hello @snoblenet

erm. The former was the implementation method used in v1 of this plugin, this was unstable and inefficient because of different import syntaxes and also you would have had to scan the opened file for these strings which could have slowed down startup times immensely.

Might I ask what your intentions are? Maybe there is a way but it is linked to what you are trying to achieve (and maybe also what kind of plugin manager you use (e.g. vim-plug allows you to specifiy the filetype you want to enable the plugin for via the for keyword, etc.)).

snoblenet commented 5 years ago

Thanks. My use case was that I was experiencing unreliable automatic indentation and the sheer number of plug-ins potentially making decisions in this area was making it hard to debug. Hence I wanted to disable plug-ins that may have a view about indentation but were not required in a given file.