tags:

views:

141

answers:

4

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 .

A: 

Searching (backwards) for ?^{ should normally get you there.

hlovdal
there are so many cases where this is wrong.....
KevinDTimm
Are there really "so many cases where this can go wrong"? The question specifically ask from "in the middle of function body", and when writing C code it should be a very non-standard coding style for a function not starting with '{' at the beginning of a line as well as having some line within the function also starting with '{'.
hlovdal
+6  A: 

[m: Go to [count] previous start of a method (for Java or similar structured language).

ax
not even similar, works in python too :)
KevinDTimm
+1  A: 

BTW, the only relatively sure way to be able to do this is to modify vim, see this post

[edit]
and this only works with languages supported by exuberant ctags. Since we've not been deigned fit to know which language you wish to do this in, it's possible that this answer will not be correct either.
[/edit]

KevinDTimm
A: 

Once you've got moving around blocks and paragraphs in code sorted you might like to look at what you can do when you're in the middle of those blocks by looking at this part of the vim doc's.

Things like delete the block, insert before the block, append after the block, etc.

HTH

Rob Wells