Eclipse surround with quotes and other blocks

前端 未结 1 1801
醉话见心
醉话见心 2020-12-24 07:26

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

相关标签:
1条回答
  • 2020-12-24 07:53

    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!

    0 讨论(0)
提交回复
热议问题