您的位置:首页 > 其它

高效开发 — Source Insight常用设置和bug修复

2018-01-17 11:58 435 查看
原文链接:http://www.cnblogs.com/bluestorm/archive/2012/10/28/2743792.html(转载文章,若有不妥,通知后我会立即删除)

Source Insight 4.0 文件类型、编码格式、tab转空格、tab键自动补全设置。。。
http://www.cnblogs.com/bluestorm/p/6864540.html
1.括号配对高亮:
“在前括号左侧,后括号左侧” 双击鼠标左键,可以选定匹配括号和其中内容(<>,(),L{R},[]之间)

2.让{ 和 } 不缩进:
Options -> Document Options -> Auto Indenting -> Auto Indent Type 选 Simple

还有:让{ 和 } 不缩进: options->document options->auto indent 去掉indent Open Brace和Indent Close Brace。 (不好使,括号无法配对对齐!)

3.添加文件类型
用户可以定义自己的类型,Options->Document Options->add type,定义文件类型名以及文件名后缀。
勾选include when adding to projects在添加目录下文件到工程是该类文件就会添加进SI的工程。
如果需要将所有文件添加进SI的工程,可以定义一种文件类型*.*。

如: 

*.java;*.jav;*.xml;*.json,*.gradle,*.bat,*.pro,*.mk,*.aidl,*.so, *.jpg,*.png,*.svg,*.webp,*.html,*.htm,*.properties,*.jar,*.aar,*.bin,*.

4.恢复ctrl+a的全选功能
Options -> Key Assignments:通过关键词save 找到save all,更改为ctrl+shift+a,通过关键词select找到select all,更改为ctrl +a

5.设置背景色:
Options->preference->color->windows background设置背景色(护眼色:85,90,205)

6.字符大小不一:
方法1:选上"view --> draft view", 就可以让每个字符的宽度一致了。快捷键是 "Alt + F12" 

方法2:解决中文注释字体间距太大:

(1).Options->Style Properties

(2). 在左边Style Name下找到Comment Multi Line和Comment.在其右边对应的Font属性框下的Font Name中选“Pick...” 设置为宋体、常规、小四。确定,退回Style Properties界面,Size设为10。最后设置Clolors框下Foreground,点“Pick...”选择一种自己喜欢的颜色就OK了

注:以上方法1为通用设置,方法2中可以设置注释字体以及字体大小!

7.删除注释时半个汉字问题(删除一个汉字,汉字没有了,但会多出一个问号?)

方法:

① 将 SuperBackspace.em 复制到 Source Insight安装目录;
② Project→Open Project,打开Base项目;
③ 将复制过去的SuperBackspace.em添加入Base项目;
④ 重启SourceInsight;
⑤ Options→Key Assignments,将Macro: SuperBackspace绑定到BackSpace键;
⑥ Enjoy!!

SuperBackspace.em 的源码在博文最后面,复制保存为SuperBackspace.em即可,或者可以在这里直接下载:http://pan.baidu.com/share/link?shareid=101784&uk=3204866771

8.实用快捷键:
Shift+F8 :高亮选中的字 
"ctrl + g" 或 "F5" :跳到指定行
“Ctrl+=” 或 Ctrl+鼠标点击标识 :直接跳转至标识定义处调用处
Ctrl+F :本文件内查找
F7 :打开Browse Project Symbols窗口,快速浏览工程内标识定义
F3 :本文件查找结果的上一个
F4 :本文件查找结果的下一个
Ctrl+M :创建或查找书签,方便下次找回此位置

9.解决TAB键缩进问题
Options-> Document Options里面的右下角Editing Options栏里,把Expand tabs勾起来,然后确定。OK,现在TAB键的缩进和四个空格的缩进在SIS里面看起来就对齐
(Linux下TAB是8个空格长度,这样设置可以让TAB和4个空格保持一致!)

10.SIS中文乱码的问题

source insight中文注释乱码问题的解决方案 - ccf19881030的专栏 - 博客频道 - CSDN.NET
http://blog.csdn.net/ccf19881030/article/details/8987759
------------------------------------------------

Source Insight常用的快捷键:

Ctrl+= :Jump to definition
Alt+/ :Look up reference
F3 : search backward
F4 : search forward
F5: go to Line
F7 :Look up symbols
F8 :Look up local symbols
F9 :Ident left
F10 :Ident right
Alt+, :Jump backword
Alt+. : Jump forward
Shift+F3 : search the word under cusor backward
Shift+F4 : search the word under cusor forward
F12 : incremental search
Shift+Ctrl+f: search in project
shift+F8 : hilight word

窗口操作:
project window Ctrl+O打开
symbol window Alt+F8打开和关闭
Contex Window 自定义键打开和关闭
Relation Window 自定义键打开 先锁定再刷新联系

 

*===========================  SuperBackspace.em ============================

* SuperBackspace Version 0.1beta

*

* 代替SourceInsight原有的Backspace功能(希望如此)

* 增加了对双字节汉字的支持,在删除汉字的时候也能同时删除汉字的高字节而缓解半个汉字问题

* 能够对光标在汉字中间的情况进行自动修正

*

* 安装:

* ① 复制入SourceInsight安装目录;

* ② Project→Open Project,打开Base项目;

* ③ 将复制过去的SuperBackspace.em添加入Base项目;

* ④ 重启SourceInsight;

* ⑤ Options→Key Assignments,将Macro: SuperBackspace绑定到BackSpace键;

* ⑥ Enjoy!!

*

* This program is free software; you can redistribute it and/or modify

* it under the terms of the GNU General Public License as published by

* the Free Software Foundation; either version 2 of the License, or

* (at your option) any later version.

*

* This program is distributed in the hope that it will be useful,

* but WITHOUT ANY WARRANTY; without even the implied warranty of

* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

* GNU General Public License for more details.

*

* You should have received a copy of the GNU General Public License

* along with this program; if not, write to the Free Software

* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

*/

macro SuperBackspace()

{

hwnd = GetCurrentWnd();

hbuf = GetCurrentBuf();

if (hbuf == 0)

stop; // empty buffer

// get current cursor postion

ipos = GetWndSelIchFirst(hwnd);

// get current line number

ln = GetBufLnCur(hbuf);

if ((GetBufSelText(hbuf) != "") || (GetWndSelLnFirst(hwnd) != GetWndSelLnLast(hwnd))) {

// sth. was selected, del selection

SetBufSelText(hbuf, " "); // stupid & buggy sourceinsight :(

// del the " "

SuperBackspace(1);

stop;

}

// copy current line

text = GetBufLine(hbuf, ln);

// get string length

len = strlen(text);

// if the cursor is at the start of line, combine with prev line

if (ipos == 0 || len == 0) {

if (ln <= 0)

stop; // top of file

ln = ln - 1; // do not use "ln--" for compatibility with older versions

prevline = GetBufLine(hbuf, ln);

prevlen = strlen(prevline);

// combine two lines

text = cat(prevline, text);

// del two lines

DelBufLine(hbuf, ln);

DelBufLine(hbuf, ln);

// insert the combined one

InsBufLine(hbuf, ln, text);

// set the cursor position

SetBufIns(hbuf, ln, prevlen);

stop;

}

num = 1; // del one char

if (ipos >= 1) {

// process Chinese character

i = ipos;

count = 0;

while (AsciiFromChar(text[i - 1]) >= 160) {

i = i - 1;

count = count + 1;

if (i == 0)

break;

}

if (count > 0) {

// I think it might be a two-byte character

num = 2;

// This idiot does not support mod and bitwise operators

if ((count / 2 * 2 != count) && (ipos < len))

ipos = ipos + 1; // adjust cursor position

}

}

// keeping safe

if (ipos - num < 0)

num = ipos;

// del char(s)

text = cat(strmid(text, 0, ipos - num), strmid(text, ipos, len));

DelBufLine(hbuf, ln);

InsBufLine(hbuf, ln, text);

SetBufIns(hbuf, ln, ipos - num);

stop;

}

*============================ SuperBackspace.em ============================ 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: