TIPS
*tips.txt* For IdeaVIM version 0.12.0. Last change: 2006 Nov 12
IdeaVIM REFERENCE MANUAL by Rick Maddy
Tips and ideas for using Vim *tips*
Don't forget to browse the user manual, it also contains lots of useful tips
|usr_toc.txt|.
Editing Java programs |Java-editing|
Editing Java programs *Java-editing*
There are quite a few features in Vim to help you edit Java program files. Here
is an overview with tags to jump to:
|usr_29.txt| Moving through programs chapter in the user manual.
|usr_30.txt| Editing programs chapter in the user manual.
|==| Re-indent a few lines.
|gd| Go to Declaration of variable under cursor.
|%| Go to matching (), {}
, [], /* */, #if, #else, #endif.
|[(| Go back to unclosed '('
|])| Go forward to unclosed ')'
|[{| Go back to unclosed '{'
|]}| Go forward to unclosed '}'
Restoring the cursor position *restore-position*
Sometimes you want to write a mapping that makes a change somewhere in the
file and restores the cursor position, without scrolling the text. For
example, to change the date mark in a file:
:map <F2>
msHmtgg/Last [cC]hange:\s*/e+1<CR>
"_D"=strftime("%Y %b %d")<CR>
p'tzt`s
Breaking up saving the position:
ms store cursor position in the 's' mark
H go to the first line in the window
mt store this position in the 't' mark
Breaking up restoring the position:
't go to the line previously at the top of the window
zt scroll to move this line to the top of the window
`s jump to the original position of the cursor