tags:

views:

744

answers:

5

If I am in the middle of the function, I would like go to the very end of it in vim. I run into this problem as we sometimes have function of 500+ lines long (don't ask why).

I use vim, gvim.

+4  A: 

][ or [] will do this for you.

Paul Betts
but only if the function's opening and closing curly braces are the first character on the line.
Nathan Fellman
+8  A: 

You can use the "]}" command. You may have to repeat it depending on how nested you are.

jthompson
the OP may also want to investigate the '%' command, which jumps to the opening or closing brace/paren/bracket that is paired with whatever is under the cursor.
rmeador
Yes, % is useful as well but not for a quick jump out of a large function.
jthompson
You might also be interested in [[ and ]], they take you to the beginning of a function or the start of the next function.
jinxed_coder
+4  A: 

][ goes to the next '}' in the first column.

Read :help 29.3 to find out more about moving through a program.

Paul
+1  A: 

Make sure you're using :split and code folding to your advantage - keep a folded view at the top of the screen, unfold a function, split, edit the function, close the split window, collapse the fold.

Phil H
+1  A: 

SHIFT+5 toggles between { and }. You can use it to identify the top most block of code.

Shree
I believe that's % which shifts :-)
MighMoS
Yes... but to make it simpler I used this approach :)
Shree