这周重新装了一下系统,原来系统32位WIN7,实在是浪费了CPU和内存。
装完以后,简直是...虚拟机5秒就启动完成了,电脑也不会卡了。
重新配置source insight 3.5
分享一下整理的utils.em
修改了一些网上的函数。
使用上需要完成:
1. 配置电脑环境变量MYNAME=***
2.将文件替换原始原件(open project:base Utils.em)
3.设置各种功能快捷
2. Options菜单Menu assignments,通过关键词为macro InsertFileHeader, insert 到edit cut.
3. 重启SourceInsight后,可以使用快捷键盘为文件自动生成注释
2. Options菜单Menu assignments,通过关键词为macro InsertHeader, insert 到edit cut.
(这里会提示已经有相应功能,无视提示。后续对Utils.em的删除只能用delete键,或者shift+backspace)
1. Options菜单 Key assignments,通过关键词为macro InsertIfdef,指定快捷键ctrl+d
2. Options菜单Menu assignments, 通过关键词为macro InsertIfdef, 添加到edit cut.
1. Options菜单 Key assignments,通过关键词为macro CodeComment,指定快捷键ctrl+/
2. Options菜单Menu assignments, 通过关键词为macro CodeComment, 添加到edit cut.
代码屏蔽#if 0
2. Options菜单Menu assignments, 通过关键词为macro MacroComment, 添加到edit cut.
2. Options菜单Menu assignments,通过关键词为macro InsertFileHeader, insert 到edit cut.
1. Options菜单Key assignments,通过关键词select找到select all, 更改为ctrl +a.(无视提示冲突)
关闭其他打开文件
1. Options菜单Key assignments,通过关键词macro CloseOldWindows, 更改为ctrl+shift +w.(无视提示冲突)
/* Utils.em - a small collection of useful editing macros */
/*-------------------------------------------------------------------------
I N S E R T H E A D E R
Inserts a comment header block at the top of the current function.
This actually works on any type of symbol, not just functions.
To use this, define an environment variable "MYNAME" and set it
to your email name. eg. set MYNAME=raygr
-------------------------------------------------------------------------*/
macro InsertHeader()
{
// Get the owner's name from the environment variable: MYNAME.
// If the variable doesn't exist, then the owner field is skipped.
szMyName = getenv(MyName)
// Get a handle to the current file buffer and the name
// and location of the current symbol where the cursor is.
hbuf = GetCurrentBuf()
szFunc = GetCurSymbol()
ln = GetSymbolLine(szFunc)
InsBufLine(hbuf, ln, "/************************************************************");
ln = ln +1
// begin assembling the title string
sz = "** 函数名称: "
/* convert symbol name to T E X T L I K E T H I S */
cch = strlen(szFunc)
ich = 0
while (ich < cch)
{
ch = szFunc[ich]
if (ich > 0)
if (isupper(ch))
sz = cat(sz, " ")
else
sz = cat(sz, " ")
sz = Cat(sz, toupper(ch))
ich = ich + 1
}
InsBufLine(hbuf, ln, sz)
ln = ln + 1
InsBufLine(hbuf, ln, "** 功能描述: ")
ln = ln + 1
InsBufLine(hbuf, ln, "** 输入参数:")
ln = ln + 1
InsBufLine(hbuf, ln, "** 输出参数: ")
ln = ln + 1
InsBufLine(hbuf, ln, "** 返 回 值 :")
ln = ln + 1
/* if owner variable exists, insert Owner: name */
if (strlen(szMyName) > 0)
{
InsBufLine(hbuf, ln, "** 作 者 : @szMyName@")
}
else
{
InsBufLine(hbuf, ln, "** 作 者 : ")
}
ln = ln + 1
// Get current time
szTime = GetSysTime(1)
Day = szTime.Day
Month = szTime.Month
Year = szTime.Year
if (Day < 10)
szDay = "0@Day@"
else
szDay = Day
InsBufLine(hbuf, ln, "** 日 期 : @Year@年@Month@月@szDay@日")
ln = ln + 1
InsBufLine(hbuf, ln, "** 版 本 : 1.0")
ln = ln + 1
InsBufLine(hbuf, ln, "** 修改日期 版本号 修改人 修改内容")
ln = ln + 1
InsBufLine(hbuf, ln, "**************************************************************/")
}
/* InsertFileHeader:
Inserts a comment header block at the top of the current function.
This actually works on any type of symbol, not just functions.
To use this, define an environment variable "MYNAME" and set it
to your email name. eg. set MYNAME=raygr
*/
macro InsertFileHeader()
{
szMyName = getenv(MyName)
hbuf = GetCurrentBuf()
InsBufLine(hbuf, 0, "/***************************************************************************")
InsBufLine(hbuf, 1, "** 版权所有: Desay Copyright (c) 2010-2015 ******************** ")
filename = GetBufName(hbuf)
InsBufLine(hbuf, 2, "** 文件名称: @filename@")
InsBufLine(hbuf, 3, "** 文件标识: ")
InsBufLine(hbuf, 4, "** 内容摘要: ")
InsBufLine(hbuf, 5, "** 当前版本: v1.0")
/* if owner variable exists, insert Owner: name */
if (strlen(szMyName) > 0)
{
sz = "** 作 者 : @szMyName@"
}
else
{
sz = "** 作 者 :"
}
InsBufLine(hbuf, 6, sz)
// Get current time
szTime = GetSysTime(1)
Day = szTime.Day
Month = szTime.Month
Year = szTime.Year
if (Day < 10)
szDay = "0@Day@"
else
szDay = Day
InsBufLine(hbuf, 7, "** 完成日期: @Year@年@Month@月@szDay@日")
InsBufLine(hbuf, 8, "** 修改记录: ")
InsBufLine(hbuf, 9, "** 修改记录: ")
InsBufLine(hbuf, 10, "** 修改日期: ")
InsBufLine(hbuf, 11, "** 版本号 : ")
InsBufLine(hbuf, 12, "