二. Options->Preferences1.Document Type & File Filter
Document Type
File Filter
C Source File
*.h;*.c;*.m;*.pch
C++ Source File
*.cpp;*.hpp;*.cxx;*.hxx
X86 Asm Source File
*.asm;*.inc;*.s;*.S
Make File
*.mak;*makefile
(1)FileFilter之间以半角分号(;)隔开。
(2)默认已勾选“Include when adding to projects”,每次“Project->Add and Remove ProjectFiles”时,勾选“Show only known document types”。
2.Editing Options
(1)默认已勾选“Allow auto-complete”、“Enter key->new line”和“SymbolWindow”;默认“Tab width”=4(一个Tab键折合四个空格键宽) ,“Margin width”=80。
(2)勾选“Allow Smart Paste”。
(3)如果要将一个Tab键展开ab width为个空格键,则勾选“Expand Tabs”;不勾选则保留tab键。一般取决于公司的代码对齐规范。
(4)勾选“Show line numbers”,将显示代码行号。
(5)勾选“Show right margin”,将在“Margin width”处显示分割线(line breaks)。
3.Auto Indent
(1)AutoIndent Type:选择Smart
(2)SmartIndent Options:去掉Indent Open Brace和Indent Close Brace
勾选AutoIndent和SMART的效果: 在C程序里, 如果遇到行末没有分号的语句,如IF, WHILE, SWITCH等,写到该行末按回车,则新行自动相对上一行缩进四列。
勾掉indentOpen Brace和IndentClose Brace的效果: 继上一段,在相对缩进行里, 如果输入"{"或"}",则自动和上一行列对齐。
4.Screen Fonts
Deja Vu Sans Mono/小四
三. Symbol Window ( left )1. Syntax Formatting
勾选“Use only color formatting”,这样函数名就不会黑体凸显,影响等宽排版。
2. Typing
勾选“Typing tab indents line,regardless of selection”(与“Typing tab replaces current selection”二选一),这样能够使用Tab键使选中的文字往后缩进4个空格,Shift+Tab则可以使选中的文字往前缩进4个空格。整体调整代码缩进时非常有效!
3. Symbol Lookups
勾选“Find symbols across different language types”,这样就可以在*.h、*.c、*.s间统一查找符号。
4. Searching
勾选“Always replace old Search Results”
四. Context Window ( left bottom )1.Symbol Operation
可以对symbol执行“Cut”、“Copy”、“Paste”和“Duplicate”操作。
2.Sort Symbol
可以SortSymbol by“Name”、“Line”或“Type”。
3.Symbol Window Properties
(1)Font:Monaco/五号;
(2)可以配置“Text Color”和“Back Color”。
五. Relation Window ( right bottom )1.Context Window Properties
(1)Font:Consolas/四号
(2)可以配置“Text Color”和“Back Color”。
六. Save/Load Configuration1.Relation Window Properties
(1)将Levels修改为2。
(2)ViewRelationShip->For Functions,默认为calls显示调用关系,修改为References显示被调用关系。
(3)Font:AndaleMono/小四
(4)可以配置“Text Color”和“Back Color”。
2.Relation WindowGraph Properties
略。
七.常用快捷键( shortcut )1.保存当前配置
Options->Save Configuration(*.CF3)
2.加载配置文件
Options->Load Configuration(*.CF3)
参考 :
1. 导航
(1)Alt+, / .
向后/向前导航(Go Back/Forwad)。
(2)F5 / Ctrl+g
跳到指定行(Go to Line)。
(3)F7 / F8
导航定位 当前项目/当前文件 符号(Browse Project/Local Symbols)。
2. 符号定位
(1)Ctrl+单击 / =
跳转到当前选中(光标所在)符号的定义处(Jump to Definition),相当于双击底端的 Symbol 窗口。
(2)Alt+/
弹出窗口显示符号定义(Pop show symbol's Definition)。
(3)Ctrl+/
查找符号引用(Lookup References),Shift+F9跳转到下一个。
3. 查找
(1)Ctrl+F
当前文件查找文本(Search for text),F3/F4跳转到上/下一个(Search Backward/Forward)。
(2)Shift+F8
高亮光标所在位置的符号。
(3)Ctrl+Shift+[/] / Ctrl+-
括号匹配/块选。
4. 编辑
(1)Ctrl+’
重命名(Smart Rename),更改函数内局部变量的名字。
(2)Alt+F12
View->Draft View:让每个字符的宽度一致。
(3)Ctrl+Z/Y
撤销/重做(Undo/Redo)。
5. 关闭
(1)Ctrl+W
关闭当前文档。
(2)Ctrl+Shift+W
关闭所有打开的文档。
(3)Alt+F4
退出Source Insight。
《十大最适合编程的字体》《下载》
《Source Insight技巧:头文件和实现文件快速切换》
《SourceInsight不支持UTF-8字符编码中文显示乱码问题》