source insight快捷键输入时间

1. 打开base项目,source insight自带的。

2. ctr + o, 可以发现utils.em文件,将如下代码添加到该文件结尾。


macro MonthToName(MonthNum)
{
    if (MonthNum == 1)
        return "Jan"
    if (MonthNum == 2)
        return "Feb"
    if (MonthNum == 3)
        return "Mar"
    if (MonthNum == 4)
        return "Apr"
    if (MonthNum == 5)
        return "May"
    if (MonthNum == 6)
        return "Jun"
    if (MonthNum == 7)
        return "Jul"
    if (MonthNum == 8)
        return "Aug"
    if (MonthNum == 9)
        return "Sep"
    if (MonthNum == 10)
        return "Oct"
    if (MonthNum == 11)
        return "Nov"
    if (MonthNum == 12)
        return "Dec"
}

//added by [email protected]
macro DisplayDate()
{
    szTime = GetSysTime(1)
    Day = szTime.Day
    Month = szTime.Month
    Year = szTime.Year
    Hour = szTime.Hour
    Minute = szTime.Minute
    Second = szTime.Second

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

    szMonth = MonthToName(Month)
    hbuf = GetCurrentBuf()
    //SetBufSelText(hbuf, "@szMonth@ @szDay@, @Year@,@Hour@:@Minute@:@Second@, added by weixuan\@yxlink.com")
    SetBufSelText(hbuf, "@szMonth@ @szDay@, @Year@, added by weixuan\@yxlink.com")
}



3. 设置快捷键,option中menu assignedment中输入marco,然后选中DisplayDate,然后点击keys设置快捷键,比如Ctrl+F7


参照:http://blog.csdn.net/makefish/article/details/5371763


你可能感兴趣的:(source,Insight,输入时间)