1. Source Insight Project menu -> Open Project -> Base Project Open.
中文版如下:项目菜单->打开项目->选择Base
2. Base Project ,打开后,在ProjectFiles列表中选择默认的 Utils.em 文件打开 .
3. 把下面的代码加进去之后 保存一下. 此时 email 地址按照自己的email修改一下.
// ccl add for hotkey
macro InsertSingleLineComment()
{
hsystemtime = GetSysTime(1)
hyear = hsystemtime.Year
hmonth = hsystemtime.Month
if( hmonth <10 )
hmonth = cat("0",hmonth)
hday = hsystemtime.Day
if( hday <10 )
hday = cat("0",hday)
hwnd = GetCurrentWnd()
lnFirst = GetWndSelLnFirst(hwnd)
hbuf = GetCurrentBuf()
InsBufLine(hbuf, lnFirst, "//@hyear@@hmonth@@hday@, changliang.chen\@lge.com, DetailDescription")
}
4. 在选项菜单中添加快捷键:Option -> Key assignment 中的 Command 里输入或查找:新定义的 Macro(“Macro: InsertSingleLineComment” )
6. Assign New Key 点击后 key(예: CTRL+SHIFT+/) 输入后 OK //热键值使用者可自定义.
7. 代码中选中某行,按下Hot key(如: “CTRL+SHIFT+/”) 按下后就会自动添加注释了
多行的注释宏定义如下,配置方法与上面的步骤一致。
macro InsertMultiLineComment()
{
hsystemtime = GetSysTime(1)
hyear = hsystemtime.Year
hmonth = hsystemtime.Month
if( hmonth <10 )
hmonth = cat("0",hmonth)
hday = hsystemtime.Day
if( hday <10 )
hday = cat("0",hday)
hwnd = GetCurrentWnd()
lnFirst = GetWndSelLnFirst(hwnd)
lnLast = GetWndSelLnLast(hwnd)
hbuf = GetCurrentBuf()
InsBufLine(hbuf, lnFirst, "//@hyear@@hmonth@@hday@, changliang.chen\@lge.com, DetailDescription [START]")
InsBufLine(hbuf, lnLast+2, "//@hyear@@hmonth@@hday@, changliang.chen\@lge.com, DetailDescription [END]")
}