Tip #666: switch between a *.cpp and matching .h file
| tip karma
Rating 26/14, Viewed by 1026
||March 1, 2004 5:12
||as of Vim:
For programmers, that want to switch from foo.cpp to foo.h (or vice versa)
on a single key stroke, this might help:
map <F4> :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp,<CR>
it maps (on F4) the change of the current filename. The endings
".h" and ".cpp" are exchanged (via the magic ending ".X123X").
You could use ".hpp" or ".c" filename endings by changing
it in the replacement statemtents.
comments are welcome
<<Hide & Toggle GUI widgets |
Navigate large CSV files more easily >>