Thank you both for your replies.
I used imap as suggested previously, it works well because it also
allows positioning the cursor to between the double quotes.
Also , if we add this
:imap sout<Press Tab> System.out.println("");<Esc>F"i
to a new file created under
C:\Program Files\Vim\vimfiles\ftplugin\java.vim
the mapping gets set each time ViM is started, so I don't have to set
the mapping each time.
I got this tip from: http://vim.wikia.com/wiki/VimTip1510 (Keep your
vimrc file clean)
I made a newbie mistake by sending this message twice
once to [email protected] and once to [email protected] thinking it
might not have reached, so sorry about that.
-Rashmi
2009/7/30 Raúl Núñez de Arenas Coronado <[email protected]>:
>
> Saluton Rashmi :)
>
> Rashmi <[email protected]> dixit:
>> Is there a way to create a shortcut so that , the entire line of code
>> System.out.println(""); would be typed with just a few keystrokes?
>>
>> For example, something like sout <tab> , would expand to
>> System.out.println("");
>
> I would use an iabbr:
>
> :iabbr sout System.out.println("");
>
> (remove the ":" at the beginning of the line if you put this command
> into your .vimrc)
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---