In GNU Emacs there is a feature to highlight matching brackets in code with the same colour.
However when the code which the brackets enclose is really long with several nested if’s for’s etc. then this feature is not really useful since one of the brackets will not be visible.
Say I have the following,
for(int i=0; i< N; ++i)
{
/*Long code*/
}
If my cursor is on the } brace I would like to have some feature which will enable me to jump / see the { brace, and then , if satisfied, come back to the } brace for any future coding.
Is this possible in Emacs?
This is actually a very standard binding:
C-M-fandC-M-bto go back and forwards by default. In most modesC-M-fwill take you forwards to the matching brace andC-M-bwill take you backwards to the matching brace. This also works for things like quotes, pretty much the same way.These bindings are easy to remember if you already use
C-fandC-bfor navigation. (If you don’t, you should.) They’re just like moving forward and backwards by a character lifted to moving by expression (which depends on mode).