When using iabbrev to abbreviate System.out.println (); as sysout, I want the cursor to be inside the parenthesis, not at the end of the sentence. Anyway to do this? Also, would it work for multi-line abbrevs? Thanks.


How about this:

iabbrev sysout System.out.println ();<Left><Left>

Note that unless you plan on adding a space inside the parentheses, you'd want to expand the abbreviation with e.g. <C-]>.

  • <c-g>U<left> is even better to permit redo. Regarding the extra space, eatchar() can be used to ignore it. Vim documentation has a note about it near:h eatchar() or :h iab I don't remember. Mar 12 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.