Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to jump to the beginning of the current function body in Vim?

Tags:

vim

As title, if I'm in the middle of function body and the function body is very long, how can I jump back to the beginning of the function body .

like image 655
Haiyuan Zhang Avatar asked Jan 21 '10 13:01

Haiyuan Zhang


People also ask

How do I jump to the beginning of a line in Vim?

Press 0 to go to the beginning of a line, or ^ to go to the first non-blank character in a line.

How do I go to the beginning of a file in Vim?

Type "gg" in command mode. This brings the cursor to the first line.

How do I go to a function in Vim?

Vim has a built in function to go to the definition by doing a clever search: With the cursor over a keyword, press gd or gD .

How do you jump back in Vim?

CTRL+O and CTRL+I , for jumping back and forward.


1 Answers

[m

Go to [count] previous start of a method

Works for Java or similar structured languages, and for Python as well.

like image 132
ax. Avatar answered Oct 10 '22 23:10

ax.