derekwyatt/vim-fswitch

Adding new file-pairs

unphased opened this issue · 2 comments

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!

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

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.