Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

shortcut for system.out.println in sublime text 2

I want to have shortcut commands in sublime text 2.

I want to simply type sopl and press tab to generate System.out.println('text'); with the word 'text' selected and ready for me to replace it.

I want to simply type sop and press tab to generate System.out.print('text'); with the word 'text' selected and ready for me to replace it.

I have installed SublimeJava plugin but apparently there is no such short cut

like image 437
Kim Stacks Avatar asked Feb 28 '13 01:02

Kim Stacks


1 Answers

You're looking for pl<tab> for System.out.println(|); and p<tab> for System.out.print(|);. It doesn't put the 'text', but it does put your cursor in the right place to type. Also note that, like Eclipse or IntelliJ, when you expand a Snippet, Tab will continue to move you through the positions in the Snippet until you've filled in all the blanks.

These are called "Snippets", and you can find them under Tools -> Snippets.... You can add new ones with Tools -> New Snippet....

like image 199
Ryan Stewart Avatar answered Oct 21 '22 02:10

Ryan Stewart