Ad blocker interference detected!
Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers
Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.
This tip shows how to easily jump to the next or previous method in a C++ program using a simple regular expression.
Jump to next/previous methodEdit
Put these lines in your vimrc and you can press Alt-Shift-J (or Alt-Shift-K) to jump to the next (or previous) method in a C++ file:
nnoremap <M-J> /\v^(\w+\s+)?\w+::\w+\(.*\) nnoremap <M-K> ?\v^(\w+\s+)?\w+::\w+\(.*\)
Better still, if this is in file
ftplugin/cpp.vim, it only activates when editing C++ files.
This only works if the format of the method is:
- Highlighting of method names in the definition for a syntax-file addition to emphasize method names