I find myself wanting to highlight a string in eclipse and double or single quoting it. I can\'t seem to find a shortcut for it. In textmate for example if i highlight a s
Go to Java > Editor > Templates and add a new template, e. g. called quote
, as follows:
"${word_selection}"${cursor}
Then, in the editor, write a text you want to quote, select it, press Ctrl+Space, type quote
and hit Return. The highlighted text should be quoted now.
If you don't get template proposals when pressing Ctrl+Space, make sure you have them checked in Java > Editor > Content Assist > Advanced.
Just tried it and it works for me!