1.给代码添加()
快捷键:ctrl+shift+z------选择expr(直接enter)
2.为文字添加“”
直接给文字添加“” 的快捷键我没找到,所以就自己做一个 live template(实时模板)
方式1:setting(或上面菜单的扳手)----搜索(live)----选择 live template----选“+”号新建live template.
方式2:ctrl+shift+z-----选择configure live..----选“+”号新建live template
进入新建页面--在Abbreviation(缩写):自己起个模板的名称:quoteme
Description写上功能描述:surrounding with quotes
tmeplate text(模板文本):写上模板样式,注意这里必须是 带$$ 的变量形式,再加上 ""
最下面的适用范围:选择 everywhere
还可以选择勾上旁边的:根据样式重新格式化(reformat according to style)
然后选择上方列表中的quoteme --右键--remove 到surround。
最后:回到 idea中选择需要的加“” 的文字,或直接放在光标放在该行----ctrl+shift+z-----选择quoteme 即可添加。