Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jump to beginning of function in emacs

Tags:

emacs

So you're in the middle of a 300 lines function, and want to know where the function declaration is.

How do you do this?

like image 778
ychaouche Avatar asked Oct 30 '12 14:10

ychaouche


2 Answers

M-C-a jumps to the beginning of the current function.

M-C-e jumps to the end of the current function

It works for elisp and c-derived languages (e.g. Java).

like image 73
Oleg Pavliv Avatar answered Nov 15 '22 16:11

Oleg Pavliv


typically, i have the which-function minor mode enabled which displays the current function on the mode line (using this in my emacs config):

(require 'which-func)
(which-function-mode t)
like image 40
jtahlborn Avatar answered Nov 15 '22 18:11

jtahlborn