Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim : Moving Through Code

I want to be able to navigate the cursor across functions using Vim. Mainly, I want a command to allow me to go to the next function, like } allows me to go to the next paragraph. I found this:

Go to the end of the C++ function in Vim

Unfortunately, it doesn't seem to work fine in JavaScript. Also, I believe it would also not work for Python, as Python don't depend much on { and }.

Any help?

like image 265
Rafid Avatar asked Jan 24 '11 09:01

Rafid


1 Answers

In a Python file I find:

  • } will take me to the end of a block,
  • ]] will take me to the start of the next function.
  • [[ takes me to the start of the current function, or the one above if I keep pressing.

]} didn't seem to work though.

like image 114
Stephen Paulger Avatar answered Oct 02 '22 16:10

Stephen Paulger