Source Insight 使用技巧Word文档格式.docx
《Source Insight 使用技巧Word文档格式.docx》由会员分享,可在线阅读,更多相关《Source Insight 使用技巧Word文档格式.docx(9页珍藏版)》请在冰豆网上搜索。
![Source Insight 使用技巧Word文档格式.docx](https://file1.bdocx.com/fileroot1/2023-1/2/342a943a-3ade-4d5a-9c8c-33ebf7a17241/342a943a-3ade-4d5a-9c8c-33ebf7a172411.gif)
ctrl"
再用鼠标指向某个变量,点击一下,就能进入这个变量的定义。
5.今天把一个用sourceinsight排版整齐的C文件,偶然用VC打开一看,全乱了。
研究了半天,发现SI对每个字符的宽度不太一致。
请教同事发现选上"
view-->
draftview"
,就可以让每个字符的宽度一致了。
快捷键是"
Alt+F12"
6."
shift+F8"
标亮所有文本中光标所在位置的单词;
7.跳到某一行:
"
ctrl+g"
;
8.屏幕字体大小:
Option–>
DocumentOption->
ScreenFonts
9.1.ShellExecuteopenexplorer/e,/select,%f
/*作用是在资源管理器中打开当前编辑文件并选中*/
/*可以设置快捷键如ctrl+e,这样能很方便的在资源管理器打开对应的文件,并进行tortoiseSVN的相关操作*/
2.X:
\Progra~1\TortoiseSVN\bin\TortoiseProc.exe/command:
log/path:
%/no
tempfile/closeonend
/*使用前注意更改对应的bin安装路径*/
/*作用是直接查看当前文件的svnlog*/
/*可以设置快捷键如ctrl+l*/
3.X:
diff/path:
%f/no
/*作用是直接查看当前文件和基准版本的比较*/
/*可以设置快捷键如ctrl+d*/
4.在SourceInsight中快速添加注释
将以下代码保存成Utils.em,详细使用说明看文章结尾。
效果如下图
/*Utils.em-asmallcollectionofusefuleditingmacros*/
/*-------------------------------------------------------------------------
INSERT
HEADER
Insertsacommentheaderblockatthetopofthecurrentfunction.
Thisactuallyworksonanytypeofsymbol,notjustfunctions.
Tousethis,defineanenvironmentvariable"
MYNAME"
andsetit
toyouremailname.
eg.setMYNAME=raygr
-------------------------------------------------------------------------*/
macroInsertHeader()
{
//Gettheowner'
snamefromtheenvironmentvariable:
MYNAME.
//Ifthevariabledoesn'
texist,thentheownerfieldisskipped.
szMyName=getenv(MYNAME)
//Getahandletothecurrentfilebufferandthename
//andlocationofthecurrentsymbolwherethecursoris.
hbuf=GetCurrentBuf()
szFunc=GetCurSymbol()
ln=GetSymbolLine(szFunc)
//beginassemblingthetitlestring
sz="
/*
"
/*convertsymbolnametoTEXT
LIKE
THIS*/
cch=strlen(szFunc)
ich=0
while(ich<
cch)
{
ch=szFunc[ich]
if(ich>
0)
if(isupper(ch))
sz=cat(sz,"
)
else
sz=Cat(sz,toupper(ch))
ich=ich+1
}
sz=Cat(sz,"
*/"
InsBufLine(hbuf,ln,sz)
InsBufLine(hbuf,ln+1,"
/*-------------------------------------------------------------------------"
/*ifownervariableexists,insertOwner:
name*/
if(strlen(szMyName)>
InsBufLine(hbuf,ln+2,"
Owner:
@szMyName@"
InsBufLine(hbuf,ln+3,"
ln=ln+4
ln=ln+2
InsBufLine(hbuf,ln,
)//provideanindentalready
-------------------------------------------------------------------------*/"
//puttheinsertionpointinsidetheheadercomment
SetBufIns(hbuf,ln,4)
}
/*InsertFileHeader:
*/
macroInsertFileHeader()
InsBufLine(hbuf,0,"
InsBufLine(hbuf,1,"
InsBufLine(hbuf,2,"
InsBufLine(hbuf,3,sz)
ln=4
ln=2
InsBufLine(hbuf,ln,"
//Inserts"
ReturnsTrue..orFalse..."
atthecurrentline
macroReturnTrueOrFalse()
ln=GetBufLineCur(hbuf)
ReturnsTrueifsuccessfulorFalseiferrors."
/*InsertsifdefREVIEWaroundtheselection*/
macroIfdefReview()
IfdefSz("
REVIEW"
);
/*InsertsifdefBOGUSaroundtheselection*/
macroIfdefBogus()
BOGUS"
/*InsertsifdefNEVERaroundtheselection*/
macroIfdefNever()
NEVER"
//Askuserforifdefconditionandwrapitaroundcurrent
//selection.
macroInsertIfdef()
sz=Ask("
Enterifdefcondition:
if(sz!
="
IfdefSz(sz);
macroInsertCPlusPlus()
__cplusplus"
//Wrapifdef<
sz>
..endifaroundthecurrentselection
macroIfdefSz(sz)
hwnd=GetCurrentWnd()
lnFirst=GetWndSelLnFirst(hwnd)
lnLast=GetWndSelLnLast(hwnd)
InsBufLine(hbuf,lnFirst,"
#ifdef@sz@"
InsBufLine(hbuf,lnLast+2,"
#endif/*@sz@*/"
//Deletethecurrentlineandappendsittotheclipboardbuffer
macroKillLine()
hbufCur=GetCurrentBuf();
lnCur=GetBufLnCur(hbufCur)
hbufClip=GetBufHandle("
Clipboard"
AppendBufLine(hbufClip,GetBufLine(hbufCur,lnCur))
DelBufLine(hbufCur,lnCur)
//PastelineskilledwithKillLine(clipboardisemptied)
macroPasteKillLine()
Paste
EmptyBuf(GetBufHandle("
))
//deletealllinesinthebuffer
macroEmptyBuf(hbuf)
lnMax=GetBufLineCount(hbuf)
while(lnMax>
DelBufLine(hbuf,0)
lnMax=lnMax-1
//Asktheuserforasymbolname,thenjumptoitsdeclaration
macroJumpAnywhere()
symbol=Ask("
Whatdeclarationwouldyouliketosee?
JumpToSymbolDef(symbol)
//listallsiblingsofauserspecifiedsymbol
//Asiblingisanyothersymboldeclaredinthesamefile.
macroOutputSiblingSymbols()
Whatsymbolwouldyouliketolistsiblingsfor?
hbuf=ListAllSiblings(symbol)
SetCurrentBuf(hbuf)
//Givenasymbolname,openthefileitsdeclaredinand
//createanewoutputbufferlistingallofthesymbolsdeclared
//inthatfile.
Returnsthenewbufferhandle.
macroListAllSiblings(symbol)
loc=GetSymbolLocation(symbol)
if(loc=="
msg("
@symbol@notfound."
stop
hbufOutput=NewBuf("
Results"
hbuf=OpenBuf(loc.file)
if(hbuf==0)
Can'
topenfile."
isymMax=GetBufSymCount(hbuf)
isym=0;
while(isym<
isymMax)
AppendBufLine(hbufOutput,GetBufSymName(hbuf,isym))
isym=isym+1
CloseBuf(hbuf)
returnhbufOutput
/*
writtenbyyubind
*/
macroSingleLineComment()
szMyName="
chenjsa"
//Getahandletothecurrentfilebufferandthename
//andlocationofthecurrentsymbolwherethecursoris.
hbuf=GetCurrentBuf()
ln=GetBufLnCur(hbuf)
//Getcurrenttime
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<
szMonth="
0@Month@"
szMonth=Month
szDescription=Ask("
请输入修改原因"
//beginassemblingthetitlestring
InsBufLine(hbuf,ln+1,"
/*@szDescription@@szMyName@.xmyanfa@Year@-@szMonth@-@szDay@*/"
macroMultiLineCommentHeader()
请输入修改原因:
InsBufLine(hbuf,ln+1,"
/*@szDescription@@szMyName@.xmyanfa@Year@-@szMonth@-@szDay@begin*/"
macroMultiLineCommentEnd()
/*@szMyName@.xmyanfa@