Source Insight 使用技巧Word文档格式.docx

上传人:b****6 文档编号:18992201 上传时间:2023-01-02 格式:DOCX 页数:9 大小:22.79KB
下载 相关 举报
Source Insight 使用技巧Word文档格式.docx_第1页
第1页 / 共9页
Source Insight 使用技巧Word文档格式.docx_第2页
第2页 / 共9页
Source Insight 使用技巧Word文档格式.docx_第3页
第3页 / 共9页
Source Insight 使用技巧Word文档格式.docx_第4页
第4页 / 共9页
Source Insight 使用技巧Word文档格式.docx_第5页
第5页 / 共9页
点击查看更多>>
下载资源
资源描述

Source Insight 使用技巧Word文档格式.docx

《Source Insight 使用技巧Word文档格式.docx》由会员分享,可在线阅读,更多相关《Source Insight 使用技巧Word文档格式.docx(9页珍藏版)》请在冰豆网上搜索。

Source Insight 使用技巧Word文档格式.docx

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@

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 自然科学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1