derekwyatt / vim-fswitch

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

Cannot find out how to configure pattern `some/path/src/something/{src,include}/namespace` #29

Closed galou closed 1 year ago

galou commented 4 years ago

I have use the following pattern:

Both directories are in a path where one of the directories is named src. How can I configure b:fswitchlocs to have vim-fswtich work? b:fswitchlocs=reg:|src|include| doesn't work because the first src is changed, not the last one.

Thanks!

wuhangchen commented 1 year ago

+1, How to savle this probleam?

galou commented 1 year ago

I don't use fswitch anymore but still have this in my configuration

autocmd BufEnter *.cpp let b:fswitchdst = 'h,hpp'
autocmd BufEnter *.cpp let b:fswitchlocs = 'reg:|src/\(.*\)/\([^w]\+\)/src|src/\1/\2/include/\2|,reg:|src|include|,reg:|src|include/*|'

Hope this helps!