如何在Eclipse中的选定文本周围添加引号

时间:2015-02-05 15:27:48

标签: eclipse keyboard-shortcuts

无数次我需要在编程期间在文本周围加上引号。我记得有一段时间以前我见过有人选择文字,只是用键盘快捷键做魔术并在其周围加上引号。怎么做?

1 个答案:

答案 0 :(得分:6)

在日食中

1. Window -> Preferences -> Java -> Editor -> Templates
2. Click on "New"
3. Type "quote" for name (you can name it whatever you want)
4. In the pattern box, enter "${word_selection}"${cursor}
5. Click ok
6. Click apply and close preferences
7. Select the string you want quoted, press CTRL + <space> and type quote