本文主要是介绍sourceInsight 快速插入时间,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
功能描述:在sourceinsight中用快捷键添加自定义的时间戳
操作步骤:
1、用everything搜索文件:utils.em(C:\Program Files (x86)\Source Insight 3)
2、用sourceinsight打开文件:utils.em
3、在文件末尾添加下面代码
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"
}macro DisplayDate()
{szTime = GetSysTime(1)Day = szTime.DayMonth = szTime.MonthYear = szTime.YearHour = szTime.HourMinute = szTime.MinuteSecond = szTime.Secondif (Day < 10)szDay = "0@Day@"elseszDay = Day//szMonth = MonthToName(Month)szMonth = Monthhbuf = GetCurrentBuf()SetBufSelText(hbuf, "@Hour@:@Minute@:@Second@ @szMonth@-@szDay@,@Year@, Domingo Sting")
}
4、Options->keyAssignments,
在Command中输入macro,
选中要使用的宏(DisplayDate),
点击assignNewKey,
按住快捷键‘ctr+T’,点击OK就行可以了
5、新建项目,把刚才修改的文件添加到新项目当中去,此时按住‘ctrl+T’时间戳就添加进去了
这篇关于sourceInsight 快速插入时间的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!