Java has curly braces that encapsulate the entire class definition. So when using the parenthsis ({ or }) key in vim, it goes to the end of the class instead of going to the next blank line or the end of the function definition. So how can I yank entire function and comment as well? In another word, I can I jump to next blank line regardless of the position?
Java has curly braces that encapsulate the entire class definition. So when using the
Share
I don’t fully understand the problem, vim should match curly brackets, you can use shift-% to toggle your cursor position on matched brackets.
With that said, if I understand you correctly(and trying it out myself) you are getting everything under the function header when you yank with ya{.
Try this:
on the end { of the function header, use ma to mark the position to register a, then % to move down to the end of the method, then y’a to yank it all. This will grab the entire function.