Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emacs navigate through curly braces in if else blocks

Tags:

emacs

GNU emacs 23.1.1

I am using emacs to debug some code. However, the if and else blocks are very big and I cannot display the whole code on my terminal as I have to scroll down many screens. And there are so many of them as most of them are nested, if hard to know which ones below to which if else block.

if(something)
{
 /* very big code block with nested if/elses */
}
else
{
/* very big code block with nested if/elses */
}

I would like to put the cursor on the first curly brace and somehow go to where this code block ends.

Hope you understand,

Many thanks for any advice,

like image 869
ant2009 Avatar asked Feb 11 '10 07:02

ant2009


1 Answers

C-M-f - forward-sexp

This will take you to the } that matches the { point is ion.

like image 91
Nathaniel Flath Avatar answered Nov 19 '22 12:11

Nathaniel Flath