工作中最常用的功能:
1.在windows的资源管理器中打开当前文件:
options-->custom commands-->Add 在弹出的窗口中键入自定义的命令名称如yuebao_open_explorer ,按ok
在RUN中键入ShellExecute open explorer /e,/select,%f,按keys,为此命令设置相应的快捷键ctrl+E。
2.为注释增加快捷键:
project-->open projec-->base打开utils.em文件
在此文件最后追加一下内容
macro SingleLineComment()
{
szMyName = "Steven Yue"
// Get a handle to the current file buffer and the name
// and location of the current symbol where the cursor is.
hbuf = GetCurrentBuf()
ln = GetBufLnCur(hbuf)
// Get current time
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
//szMonth = NumToName(Month)
if (Month < 10)
szMonth = "0@Month@"
else
szMonth = Month
szDescription = Ask("请输入修改原因")
// begin assembling the title string
//InsBufLine(hbuf, ln+1, "/*@szDescription@ @szMyName@.xmyanfa @Year@-@szMonth@-@szDay@*/")
InsBufLine(hbuf, ln+1, "/* @szMyName@ Modified For @szDescription@ /@@Year@-@szMonth@-@szDay@*/")
}
macro MultiLineCommentHeader()
{
szMyName = "Steven Yue"
// Get a handle to the current file buffer and the name
// and location of the current symbol where the cursor is.
hbuf = GetCurrentBuf()
ln = GetBufLnCur(hbuf)
// Get current time
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
//szMonth = NumToName(Month)
if (Month < 10)
szMonth = "0@Month@"
else
szMonth = Month
szDescription = Ask("请输入修改原因:")
//MultiLineCommAddDescription = Ask("请输入修改原因:")
// begin assembling the title string
InsBufLine(hbuf, ln + 1, "/* @szMyName@ Modified for @szDescription@ /@@Year@-@szMonth@-@szDay@ begin*/")
//InsBufLine(hbuf, ln + 1, "/* @szMyName@ Modified for @MultiLineCommAddDescription@ /@@Year@-@szMonth@-@szDay@ begin*/")
}
macro MultiLineCommentEnd()
{
szMyName = "Steven Yue"
// Get a handle to the current file buffer and the name
// and location of the current symbol where the cursor is.
hbuf = GetCurrentBuf()
ln = GetBufLnCur(hbuf)
// Get current time
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
//szMonth = NumToName(Month)
if (Month < 10)
szMonth = "0@Month@"
else
szMonth = Month
InsBufLine(hbuf, ln + 1, "/*@szMyName@ Modified /@@Year@-@szMonth@-@szDay@ end*/")
//InsBufLine(hbuf, ln + 1, "/*@szMyName@ Modified for @MultiLineCommAddDescription@ /@@Year@-@szMonth@-@szDay@ end*/")
}
保存之后,进入options-->key assingenments,可以看到command下多出了这三个宏
macro:SingleLineComment,macro:MultiLineCommentHeader,macro:MultiLineCommentEnd
选择相应的宏赋自定义的快捷键即可,单行注释我的快捷键是Atl+C。
在源码文件中按atl+c,会弹出