derekwyatt / vim-fswitch

Vim plug for switching between companion source files (e.g. ".h" and ".cpp")
179 stars 57 forks source link

Adding new file-pairs #12

Closed unphased closed 9 years ago

unphased commented 9 years ago

I found that I was wanting to use this plugin to quickly open the fragment/vertex shader files that have the same name, but there are many naming schemes for these shader files (perhaps even more than there are for c/cpp files! --- e.g. vsh/fsh, vert/frag, etc).

Similarly with objective-c and objective-c++, there are .m and .mm files that can map to .h's.

Anyways even though the documentation goes into quite some depth (though the github readme is alarmingly unhelpful) it does not seem to provide any pointers for how a user like me might be able to quickly add new definitions.

I hope you can shed some light on this, and hopefully we can get that added to at least the vim help file for the plugin.

Thanks!

choucavalier commented 9 years ago

Isn't au! BufEnter *.m let b:fswitchdst = 'h' working for you?

unphased commented 9 years ago

Hmm yes! I already have this in my vimrc:

au BufEnter *.mm  let b:fswitchdst = 'h' | let b:fswitchlocs = 'reg:/src/include/,reg:|src|include/**|,ifrel:|/src/|../include|'

Quite usable.