source insight 添加自定義macro

  打開C:\Documents and Settings\xxxx\My Documents\Source Insight\Projects\Base文件夾下的em文件,能夠看到都是由macro定義的一系列函數,附件是我改寫的一個比較簡單的註釋宏,你們能夠將它複製粘貼到該em文件裏,而後按相似操做爲這個宏設置一個快捷鍵函數

  固然咱們還能夠本身建立em文件,建立後保存到C:\Documents and Settings\xxxx\My Documents\Source Insight\Projects\Base文件夾下spa

而後打開 SI->project, open->BASE project.code

 SI->project, add project file,將保存的em文件加入到BASE project中.xml

 SI->option, key assignments中, 找到你所編寫的宏MACRO:InsertMark,爲這個宏設置一個快捷鍵,好比ctrl+alt +/。blog

macro InsertMark()
{
    hbuf = GetCurrentBuf()
    ln = GetBufLnCur(hbuf)
    
    szTime = GetSysTime(1)
    Hour = szTime.Hour
    Minute = szTime.Minute
    Second = szTime.Second
    Day = szTime.Day
    Month = szTime.Month
    Year = szTime.Year

    if (Day < 10)
          szDay = "0@Day@"
     else
          szDay = Day
     if (Month < 10)
        szMonth = "0@Month@"
     else
          szMonth = Month

    InsBufLine(hbuf, ln, "// Add By Author [@szDay@/@szMonth@/@Year@] For ## Begin")
    InsBufLine(hbuf, ln+2, "// Add By Author [@szDay@/@szMonth@/@Year@] For ## End")
}
相關文章
相關標籤/搜索