live template 即可实现.无需插件
最终效果
/** 2015/09/20 01:33:34
* end */
- 打开 settings(win) or preferences
- 找到 editor下的 live template
- 选中你的语言
- 点右边的 + 号
- Abbreviation 是自动完成的提示缩写(例如:nowtime) description 描述(例如:now time.comment)
template text 模板文件内容 例如:
/** $nowtime$
<ul><li>$end$ */
- 然后点 edit variable
- 在 nowtime 一行 输入
date("yyyy-MM-dd HH:mm:ss")
或者 data() 等你要的格式化效果 - 勾选 skip if define 点 ok
- 选中 reformat according to style (会根据你输入的位置智能缩进)
- (No applicable contexts yet.) Define (点它.与相应的语言相关联)
- 大功告成!
可以到 编辑器里 输入 你定义的 Abbreviation 试试了 .例如:nowtime +tab
idea 太强大了