




已阅读5页,还剩5页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Source Insight 使用技巧1. sourceinsightscreen font的默认字体是Verdana的,它是一直变宽字体。在Document style中可以将字体改为定宽的Courier,个人更喜欢Courier new字体。2. 新开一个PROJECT后,点Options-Document Options,弹出对话框后先在左上角选好要用的Document Type,主要就是设C Source File和C+ Source File,选好后点右边中间的Auto Indent调整缩进。单选里一定要点Smart,右边有两个复选框Indent Open Brace和Indent Close Brace,具体效果是如何的可以看SIS的HELP。最方便的就是把两个复选框都取消掉。然后点OK; 勾选Auto Indent和SMART的效果: 在C程序里, 如果遇到行末没有分号的语句,如IF, WHILE, SWITCH等, 写到该行末按回车,则新行自动相对上一行缩进四列。勾掉indent Open Brace和Indent Close Brace的效果: 继上一段,在相对缩进行里, 如果输入或, 则自动和上一行列对齐3. 不论是我们公司或者华为编程规范里,都有不能用TAB键而必须用4个SPACE代替的说法。我最恨这条了,那键盘上的TAB键是干什么用的。不过确实以前写代码时候很头痛的问题是在SIS界面里,即使设置好了Tab Width=4,按四个空格所显示的缩进,和按TAB键的缩进位置是不同的,后者要更靠里面三个字符的位置,但在左下角看到的Col=5都是一样的。这样的代码在SIS里看了不对齐,到PB里看了却是对齐的。而SIS里面看着对其的代码,在PB里面会差三格。现在发现Options-Document Options里面的右下角Editing Options栏里,把Expand tabs勾起来,然后确定。OK,现在TAB键的缩进和四个空格的缩进在SIS里面看起来就对齐咯!其实我是有点想不通,为什么expend不勾的时候,tab键效果expend了,而勾起来却shrink了呢?4. 按住ctrl, 再用鼠标指向某个变量,点击一下,就能进入这个变量的定义。5. 今天把一个用sourceinsight排版整齐的C文件,偶然用VC打开一看,全乱了。研究了半天,发现SI对每个字符的宽度不太一致。请教同事发现选上view - draft view, 就可以让每个字符的宽度一致了。快捷键是 Alt + F126. shift+F8 标亮所有文本中光标所在位置的单词;7. 跳到某一行:ctrl + g;8. 屏幕字体大小:Option Document Option - Screen Fonts9. 1.ShellExecute open explorer /e,/select,%f/*作用是在资源管理器中打开当前编辑文件并选中*/*可以设置快捷键如ctrl+e,这样能很方便的在资源管理器打开对应的文件,并进行tortoiseSVN的相关操作*/2.X:Progra1TortoiseSVNbinTortoiseProc.exe /command:log /path:% /notempfile /closeonend /*使用前注意更改对应的bin安装路径*/ /*作用是直接查看当前文件的svn log*/ /*可以设置快捷键如ctrl+l*/3.X:Progra1TortoiseSVNbinTortoiseProc.exe /command:diff /path:%f /notempfile /closeonend /*使用前注意更改对应的bin安装路径*/ /*作用是直接查看当前文件和基准版本的比较*/ /*可以设置快捷键如ctrl+d*/ 4.在Source Insight中快速添加注释 将以下代码保存成Utils.em,详细使用说明看文章结尾。效果如下图/* 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 owners name from the environment variable: MYNAME. / If the variable doesnt 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) / 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 0) if (isupper(ch) sz = cat(sz, ) else sz = cat(sz, ) sz = Cat(sz, toupper(ch) ich = ich + 1 sz = Cat(sz, */) InsBufLine(hbuf, ln, sz) InsBufLine(hbuf, ln+1, /*-) /* if owner variable exists, insert Owner: name */ if (strlen(szMyName) 0) InsBufLine(hbuf, ln+2, Owner: szMyName) InsBufLine(hbuf, ln+3, ) ln = ln + 4 else ln = ln + 2 InsBufLine(hbuf, ln, ) / provide an indent already InsBufLine(hbuf, ln+1, -*/) / put the insertion point inside the header comment SetBufIns(hbuf, ln, 4)/* 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, /*-) /* if owner variable exists, insert Owner: name */ InsBufLine(hbuf, 1, ) if (strlen(szMyName) 0) sz = Owner: szMyName InsBufLine(hbuf, 2, ) InsBufLine(hbuf, 3, sz) ln = 4 else ln = 2 InsBufLine(hbuf, ln, -*/)/ Inserts Returns True . or False. at the current linemacro ReturnTrueOrFalse() hbuf = GetCurrentBuf() ln = GetBufLineCur(hbuf) InsBufLine(hbuf, ln, Returns True if successful or False if errors.)/* Inserts ifdef REVIEW around the selection */macro IfdefReview() IfdefSz(REVIEW);/* Inserts ifdef BOGUS around the selection */macro IfdefBogus() IfdefSz(BOGUS);/* Inserts ifdef NEVER around the selection */macro IfdefNever() IfdefSz(NEVER);/ Ask user for ifdef condition and wrap it around current/ selection.macro InsertIfdef() sz = Ask(Enter ifdef condition:) if (sz != ) IfdefSz(sz);macro InsertCPlusPlus() IfdefSz(_cplusplus);/ Wrap ifdef . endif around the current selectionmacro IfdefSz(sz) hwnd = GetCurrentWnd() lnFirst = GetWndSelLnFirst(hwnd) lnLast = GetWndSelLnLast(hwnd) hbuf = GetCurrentBuf() InsBufLine(hbuf, lnFirst, #ifdef sz) InsBufLine(hbuf, lnLast+2, #endif /* sz */)/ Delete the current line and appends it to the clipboard buffermacro KillLine() hbufCur = GetCurrentBuf(); lnCur = GetBufLnCur(hbufCur) hbufClip = GetBufHandle(Clipboard) AppendBufLine(hbufClip, GetBufLine(hbufCur, lnCur) DelBufLine(hbufCur, lnCur)/ Paste lines killed with KillLine (clipboard is emptied)macro PasteKillLine() Paste EmptyBuf(GetBufHandle(Clipboard)/ delete all lines in the buffermacro EmptyBuf(hbuf) lnMax = GetBufLineCount(hbuf) while (lnMax 0) DelBufLine(hbuf, 0) lnMax = lnMax - 1 / Ask the user for a symbol name, then jump to its declarationmacro JumpAnywhere() symbol = Ask(What declaration would you like to see?) JumpToSymbolDef(symbol) / list all siblings of a user specified symbol/ A sibling is any other symbol declared in the same file.macro OutputSiblingSymbols() symbol = Ask(What symbol would you like to list siblings for?) hbuf = ListAllSiblings(symbol) SetCurrentBuf(hbuf)/ Given a symbol name, open the file its declared in and / create a new output buffer listing all of the symbols declared/ in that file. Returns the new buffer handle.macro ListAllSiblings(symbol) loc = GetSymbolLocation(symbol) if (loc = ) msg (symbol not found.) stop hbufOutput = NewBuf(Results) hbuf = OpenBuf(loc.file) if (hbuf = 0) msg (Cant open file.) stop isymMax = GetBufSymCount(hbuf) isym = 0; while (isym isymMax) AppendBufLine(hbufOutput, GetBufSymName(hbuf, isym) isym = isym + 1 CloseBuf(hbuf) return hbufOutput/* written by yubind */macro SingleLineComment()szMyName = chenjsa/ 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 timeszTime = GetSysTime(1)Hour = szTime.HourMinute = szTime.MinuteSecond = szTime.SecondDay = szTime.DayMonth = szTime.MonthYear = szTime.Yearif (Day 10) szDay = 0Dayelse szDay = Day/szMonth = NumToName(Month)if (Month 10) szMonth = 0Monthelse szMonth = MonthszDescription = Ask(请输入修改原因)/ begin assembling the title stringInsBufLine(hbuf, ln+1, /*szDescription szMyName.xmyanfa Year-szMonth-szDay*/)macro MultiLineCommentHeader()szMyName = chenjsa/ 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 timeszTime = GetSysTime(1)Hour = szTime.HourMinute = szTime.MinuteSecond = szTime.SecondDay = szTime.DayMonth = szTime.MonthYear = szTime.Yearif (Day 10) szDay = 0Dayelse szDay = Day/szMonth = NumToName(Month)if (Month 10) szMonth = 0Monthelse szMonth = MonthszDescription = Ask(请输入修改原因:)/ begin assembling the title stringInsBufLine(hbuf, ln + 1, /*szDescription sz
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 企业会议纪要格式与范例集
- 吕梁职业技术学院《污染场地管理与修复》2024-2025学年第一学期期末试卷
- 广州民航职业技术学院《数据挖掘与数据分析》2024-2025学年第一学期期末试卷
- 德宏职业学院《岩石力学》2024-2025学年第一学期期末试卷
- 徽商职业学院《酒店服务心理学》2024-2025学年第一学期期末试卷
- 榆林职业技术学院《语言程序设计实验》2024-2025学年第一学期期末试卷
- 制造业生产流程优化实务指导
- 新课程标准学习计划与方法
- (2025年标准)出国比赛协议书
- 脊柱术后康复训练
- 中国精神障碍分类与诊断标准第3版
- 《电力建设工程施工安全管理导则》(NB∕T 10096-2018)
- 电梯维护保养规则(TSG T5002-2017)
- GB/T 7113.5-2011绝缘软管第5部分:硅橡胶玻璃纤维软管
- GB/T 4668-1995机织物密度的测定
- GB/T 29256.5-2012纺织品机织物结构分析方法第5部分:织物中拆下纱线线密度的测定
- GB/T 27750-2011绝缘液体的分类
- GB/T 27021.1-2017合格评定管理体系审核认证机构要求第1部分:要求
- GB/T 1410-2006固体绝缘材料体积电阻率和表面电阻率试验方法
- 工会法律知识考试参考题库350题(含答案)
- 产品说明中文asd-7110管状体电机说明书
评论
0/150
提交评论