sourceinsight 添加宏网络内怎么删除添加的相机

source insight的中文删除解决办法superbackspace - CSDN博客
source insight的中文删除解决办法superbackspace
ource insight 3.50,英文版。相信一定有人用的相同的设置。
(1)设置字体大小;设置Tab为4个空格。
长时间看程序谁也受不了,所以设置大号字体是必须的。
在Option-&Docutment Option里设置Screen Fonts和Tab Width。
另外点击Auto Indenting,取消右边的两个选择,即设置{和}不自动缩进
(2)设置中文注释为一个字符宽度
baidu来的,很管用。在Option-&Style Properties中,先在左边列表里选择Comment,在右边的Font Name下拉菜单中选择Pick,然后设置为宋体等,设置完了就Ok。同样选择Comment Multi Line完成相同操作。
(3)更改快捷键
取消小键盘,baidu来的:
Options菜单àKey assignments,通过关键词Scroll&找到Scroll Half Page Up,取消小键盘/;通过关键词Scroll&找到Scroll
Half Page Down取消小键盘*;通过关键词Function找到Function Up,取消小键盘-,通过关键词Function找到Function down,取消小键盘+。
设置全选快捷键:在Options菜单àKey assignments里面找到Save all,取消ctrl+a快捷键;选择select all,设置为Ctrl+a。
设置删除整行快捷键,Edit: Delete Line设为shift+del.
(4)双字符操作更好一些
baidu来的,使用下面的一个宏,即Project→Open Project,打开Base项目;新建一个SuperBackSpace.em文件,将下面的代码加入进去并保存,并将文件加入到Base项目;重启SourceInsight;打开Options→Key Assignments,将Marco: SuperBackspace绑定到BackSpace键,Marco: SuperCursorLeft绑定到&-键,Marco:
SuperCursorRight绑定到-&键,Marco: SuperShiftCursorLeft绑定到Shift+&-,macro,SuperShiftCursorRight绑定到shift+-&,Macro:SuperDelete绑定到del。
* 2006 丁兆杰 Ding Zhaojie
* SuperBackspace Version 0.1beta
* 代替SourceInsight原有的Backspace功能(希望如此)
* 增加了对双字节汉字的支持,在删除汉字的时候也能同时删除汉字的高字节而缓解半个汉字问题
* 能够对光标在汉字中间的情况进行自动修正
* ① 复制入SourceInsight安装目录;
* ② Project→Open Project,打开Base项目;
* ③ 将复制过去的SuperBackspace.em添加入Base项目;
* ④ 重启SourceInsight;
* ⑤ Options→Key Assignments,将Marco: SuperBackspace绑定到BackSpace键;
* ⑥ Enjoy!!
* This prog you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software F 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
* alo if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
macro SuperBackspace()
&&& hwnd = GetCurrentWnd();
&&& hbuf = GetCurrentBuf();
&&& if (hbuf == 0)
&&&&&&&&& // 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);
&&& // 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)
&&&&&&&&&&&&& // 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);
&&& num = 1; // del one char
&&& if (ipos &= 1) {
&&&&&&& // process Chinese character
&&&&&&& i =
&&&&&&& count = 0;
&&&&&&& while (AsciiFromChar(text[i - 1]) &= 160) {
&&&&&&&&&&& i = i - 1;
&&&&&&&&&&& count = count + 1;
&&&&&&&&&&& if (i == 0)
&&&&&&&&&&&&&&&
&&&&&&& 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 =
&&& // 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);
以下是自编,参考上面以及SourceInsight中的chm帮助文档;
有缺点:(1)移动箭头也会记录到历史操作步骤,应该能够避免这些操作被记录;(2)函数没有整理,有冗余;
//2、删除键——SuperDelete.em
macro SuperDelete()
&&& hwnd = GetCurrentWnd();
&&& hbuf = GetCurrentBuf();
&&& if (hbuf == 0)
&&&&&&&&& // 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 & &
&&&&&&& SuperDelete(1);
&&& // copy current line
&&& text = GetBufLine(hbuf, ln);
&&& // get string length
&&& len = strlen(text);
&&& if (ipos == len || len == 0) {
totalLn = GetBufLineCount (hbuf);
lastText = GetBufLine(hBuf, totalLn-1);
lastLen = strlen(lastText);
&&&&&&& if (ipos == lastLen)// end of file
&&&&&&& ln = ln + 1;&&& // do not use &ln--& for compatibility with older versions&
&&&&&&& nextline = GetBufLine(hbuf, ln);
&&&&&&& nextlen = strlen(nextline);
&&&&&&& // combine two lines
&&&&&&& text = cat(text, nextline);
&&&&&&& // del two lines
&&&&&&& DelBufLine(hbuf, ln-1);
&&&&&&& DelBufLine(hbuf, ln-1);
&&&&&&& // insert the combined one
&&&&&&& InsBufLine(hbuf, ln-1, text);
&&&&&&& // set the cursor position
&&&&&&& SetBufIns(hbuf, ln-1, len);
&&& num = 1; // del one char
&&& if (ipos & 0) {
&&&&&&& // process Chinese character
&&&&&&& i =
&&&&&&& count = 0;
&&&&&&& while (AsciiFromChar(text[i-1]) &= 160) {
&&&&&&&&&&& i = i - 1;
&&&&&&&&&&& count = count + 1;
&&&&&&&&&&& if (i == 0)
&&&&&&&&&&&&&&&
&&&&&&& 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) || count == 0) && (ipos & len-1))&
&&&&&&&&&&&&&&& ipos = ipos + 1;&&& // adjust cursor position
// keeping safe
if (ipos - num & 0)
&&&&&&&&&&& num =&
&&& else {
count = 0;
while(AsciiFromChar(text[i]) &= 160) {
&&&& i = i + 1;
&&&& count = count + 1;
&&&& if(i == len-1)
if(count & 0) {
&&&& num = 2;
&&& text = cat(strmid(text, 0, ipos), strmid(text, ipos+num, len));
&&& DelBufLine(hbuf, ln);
&&& InsBufLine(hbuf, ln, text);
&&& SetBufIns(hbuf, ln, ipos);
//3、左移键——SuperCursorLeft.em
macro IsComplexCharacter()&
hwnd = GetCurrentWnd();
hbuf = GetCurrentBuf();
if (hbuf == 0)&
&& return 0;
//当前位置
pos = GetWndSelIchFirst(hwnd);
//当前行数
ln = GetBufLnCur(hbuf);
//得到当前行
text = GetBufLine(hbuf, ln);
//得到当前行长度
len = strlen(text);
//从头计算汉字字符的个数
if(pos & 0)&
&& count=0;
&& while(AsciiFromChar(text[i-1]) &= 160)
&&& i = i - 1;
&&& count = count+1;
&&& if(i == 0)&
&& if((count/2)*2==count|| count==0)
&&& return 0;
&&& return 1;
macro moveleft()&
hwnd = GetCurrentWnd();
hbuf = GetCurrentBuf();
if (hbuf == 0)
&&&&&&&&& // empty buffer
ln = GetBufLnCur(hbuf);&
ipos = GetWndSelIchFirst(hwnd);
if(GetBufSelText(hbuf) != && || (ipos == 0 && ln == 0))&& // 第0行或者是选中文字,则不移动
&& SetBufIns(hbuf, ln, ipos);&
if(ipos == 0)&
&& preLine = GetBufLine(hbuf, ln-1);
&& SetBufIns(hBuf, ln-1, strlen(preLine)-1);
&& SetBufIns(hBuf, ln, ipos-1);&
macro SuperCursorLeft()
moveleft();&
if(IsComplexCharacter())
&& moveleft();
//4、右移键——SuperCursorRight.em
macro moveRight()&
hwnd = GetCurrentWnd();
hbuf = GetCurrentBuf();
if (hbuf == 0)
&&&&&&&&& // empty buffer
ln = GetBufLnCur(hbuf);&
ipos = GetWndSelIchFirst(hwnd);
totalLn = GetBufLineCount(hbuf);&
text = GetBufLine(hbuf, ln);
if(GetBufSelText(hbuf) != &&)&& //选中文字
&& ipos = GetWndSelIchLim(hwnd);
&& ln = GetWndSelLnLast(hwnd);
&& SetBufIns(hbuf, ln, ipos);&
if(ipos == strlen(text)-1 && ln == totalLn-1) // 末行&
if(ipos == strlen(text))&
&& SetBufIns(hBuf, ln+1, 0);
&& SetBufIns(hBuf, ln, ipos+1);&
macro SuperCursorRight()
moveRight();&
if(IsComplexCharacter()) // defined in SuperCursorLeft.em
&& moveRight();
//5、shift+右移键——ShiftCursorRight.em
macro IsShiftRightComplexCharacter()&
hwnd = GetCurrentWnd();
hbuf = GetCurrentBuf();
if (hbuf == 0)&
&& return 0;
selRec = GetWndSel(hwnd);&
pos = selRec.ichL&
ln = selRec.lnL&
text = GetBufLine(hbuf, ln);&
len = strlen(text);
if(len == 0 || len & pos)
&& return 1;
//Msg(&@len@;@pos@;&);&
if(pos & 0)&
&& count=0;&
&& while(AsciiFromChar(text[i-1]) &= 160)
&&& i = i - 1;
&&& count = count+1;&&&
&&& if(i == 0)&
&& if((count/2)*2==count|| count==0)
&&& return 0;
&&& return 1;
macro shiftMoveRight()&
hwnd = GetCurrentWnd();
hbuf = GetCurrentBuf();
if (hbuf == 0)
&&&&&&&&&&
ln = GetBufLnCur(hbuf);&
ipos = GetWndSelIchFirst(hwnd);
totalLn = GetBufLineCount(hbuf);&
text = GetBufLine(hbuf, ln);&
selRec = GetWndSel(hwnd);&&
curLen = GetBufLineLength(hbuf, selRec.lnLast);&
if(selRec.ichLim == curLen+1 || curLen == 0)
&& if(selRec.lnLast == totalLn -1)
&& selRec.lnLast = selRec.lnLast + 1;&
&& selRec.ichLim = 1;
&& SetWndSel(hwnd, selRec);
&& if(IsShiftRightComplexCharacter())
&&& shiftMoveRight();
selRec.ichLim = selRec.ichLim+1;
SetWndSel(hwnd, selRec);
macro SuperShiftCursorRight()
if(IsComplexCharacter())
&& SuperCursorRight();
shiftMoveRight();&
if(IsShiftRightComplexCharacter())
&& shiftMoveRight();
//6、shift+左移键——ShiftCursorLeft.em
macro IsShiftLeftComplexCharacter()&
hwnd = GetCurrentWnd();
hbuf = GetCurrentBuf();
if (hbuf == 0)&
&& return 0;
selRec = GetWndSel(hwnd);&
pos = selRec.ichF&
ln = selRec.lnF&
text = GetBufLine(hbuf, ln);&
len = strlen(text);
if(len == 0 || len & pos)
&& return 1;
//Msg(&@len@;@pos@;&);&
if(pos & 0)&
&& count=0;&
&& while(AsciiFromChar(text[i-1]) &= 160)
&&& i = i - 1;
&&& count = count+1;&&&
&&& if(i == 0)&
&& if((count/2)*2==count|| count==0)
&&& return 0;
&&& return 1;
macro shiftMoveLeft()&
hwnd = GetCurrentWnd();
hbuf = GetCurrentBuf();
if (hbuf == 0)
&&&&&&&&&&
ln = GetBufLnCur(hbuf);&
ipos = GetWndSelIchFirst(hwnd);
totalLn = GetBufLineCount(hbuf);&
text = GetBufLine(hbuf, ln);&
selRec = GetWndSel(hwnd);&&
//curLen = GetBufLineLength(hbuf, selRec.lnFirst);
//Msg(&@curLen@;@selRec@&);
if(selRec.ichFirst == 0)
&& if(selRec.lnFirst == 0)
&& selRec.lnFirst = selRec.lnFirst - 1;
&& selRec.ichFirst = GetBufLineLength(hbuf, selRec.lnFirst)-1;
&& SetWndSel(hwnd, selRec);
&& if(IsShiftLeftComplexCharacter())
&&& shiftMoveLeft();
selRec.ichFirst = selRec.ichFirst-1;
SetWndSel(hwnd, selRec);
macro SuperShiftCursorLeft()
if(IsComplexCharacter())
&& SuperCursorLeft();
shiftMoveLeft();&
if(IsShiftLeftComplexCharacter())
&& shiftMoveLeft();
============================================================================
Source Insight技巧收集
1、背景色选择
&&& 要改变背景色Options-&preference-&windows background-&color设置背景色
2、解决字符等宽对齐问题。
&&& SIS默认字体是VERDANA,很漂亮。这网页上应该也是用的VERDANA字体。但由于美观的缘故,VERDANA字体是不等宽的。比如下面两行
&&& llllllllll
&&& MMMMMMMMMM
&&& 同样10个字符,长度差多了.用VERDANA来看程序,有些本应该对齐的就歪了。解放方法是使用等宽的字体,但肯定比较丑。比较推荐的是用Courier New。
3、解决TAB键缩进问题
&&& Options-& Document Options里面的右下角Editing Options栏里,把Expand tabs勾起来,然后确定。OK,现在TAB键的缩进和四个空格的缩进在SIS里面看起来就对齐咯
4、SI中的自动对齐设置:
&&& 在C程序里, 如果遇到行末没有分号的语句,如IF, WHILE, SWITCH等, 写到该行末按回车,则新行自动相对上一行缩进两列。
&&& Option-&Document option下的Auto Indient中Auto Indient Type有三种类型 None,Simple,Smart。个人推荐选用Simple类型。
5、向项目中添加文件时,只添加特定类型的文件(文件类型过滤器)
&&& 编辑汇编代码时,在SIS里建立PROJECT并ADD TREE的时候,根据默认设置并不会把该TREE里面所有汇编文件都包含进来
&&& 只加了.inc和.asm后缀的,.s后缀的没有。而且用SIS打开.s的文件,一片黑白没有色彩,感觉回到DOS的EDIT时代了……
&&& 解决方法是在Options-&Document Options里面,点左上的Document Type下拉菜单,选择x86 Asm Source File,
&&& 然后在右边的File filter里*.asm;*.inc;的后面加上*.s;接着CLOSE就可以了。
&&& 上面问题解决了,但注意加入*.s后还需要重新ADD TREE一遍才能把这些汇编加到PROJECT里面。
6、添加文件类型
&&& 用户可以定义自己的类型,Options-&Document Options-&add type,定义文件类型名以及文件名后缀。
&&& 勾选include when adding to projects在添加目录下文件到工程是该类文件就会添加进SI的工程。
&&& 如果需要将所有文件添加进SI的工程,可以定义一种文件类型*.*。
7、恢复ctrl+a的全选功能
&&& 通过关键词save 找到save all,更改为ctrl+shift+a,通过关键词select找到select all,更改为ctrl +a
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
Source Insight的窗口操作:
&&& project window Ctrl+O打开
&&& symbol window Alt+F8打开和关闭
&&& Contex Window 自定义键打开和关闭
&&& Relation Window 自定义键打开 先锁定再刷新联系
在Source Insight中添加自定义功能的步骤如下:
1.Source Insight中,Options-&Custom Commands...-&Add...,New Command name 随便写,我的是&Edit with Vim&
2.Run中写入: &C:\Program Files\Vim\vim63\gvim.exe& --remote-silent +%l %f
意思是在当前已经打开的gvim窗口里面打开当前的文件,并且跳转到指定行
%l为当前的行号,%f为文件名
使用 --remote-silent 的作用是,如果已经打开了对应文件,就不会打开第二次,而是在已经打开的文件里跳转到对应行
3.还是同一个对话框里面,选择Keys-&Assign New Key...-&按F12,如果你已经将F12设置给其他命令,选择其他的按键就行了
下面是一些常用自定义功能:( CUSTOM COMMANDS )
打开资源管理器并选中当前文件
ShellExecute open explorer /e,/select,%f
&C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe& /command:log /path:%f /notempfile /closeonend
&C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe& /command:diff /path:%f /notempfile /closeonend
取得锁定(check out)
&C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe& /command:lock /path:%f /notempfile /closeonend
提交(check in)
&C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe& /command:commit /path:%f /notempfile /closeonend
更新(update)
&C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe& /command:update /path:%f /notempfile /closeonend
更新整个目录(update all)
&C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe& /command:update /path:*.* /notempfile /closeonend
取消锁定(undo check out)
&C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe& /command:revert /path:%f /notempfile /closeonend
在ultriEdit中编辑
&C:\Program Files\UltraEdit-32/uedit32& %f
在vim中编辑并定位到当前行
&C:\Program Files\Vim\vim63\gvim.exe& --remote-silent +%l %f
汇总其他小技巧:
让{ 和 } 不缩进:
Options-&Document Options-&Auto Indent-&Indent Open Brace/Indent Close Brace
hao space: SourceInsight 小技巧
1、按住&ctrl&, 再用鼠标指向某个变量,点击一下,就能进入这个变量的定义。
2、今天把一个用sourceinsight排版整齐的C文件,偶然用VC打开一看,全乱了。研究了半天,发现SI对每个字符的宽度不太一致。
&&& 请教同事发现选上&view --& draft view&, 就可以让每个字符的宽度一致了。快捷键是 &Alt + F12&
3、&shift+F8& 标亮所有文本中光标所在位置的单词
4、跳到某一行:&ctrl + g&
Source Insight是阅读和编写代码的好东东,基本上也算得上是经典之作了,虽然还有一点点小bug,不过对于我们这些C程序员来说可是一旦拥有别无所求。下列小技巧是在工作中同事整理总结的,对提高工作效率多少有点帮助,其中有些是对应于SVN的,没有使用SVN做版本管理的人就不要白费力气了。
ShellExecute open explorer /e,/select,%f
&&&&&&& /*作用是在资源管理器中打开当前编辑文件并选中*/
&&&&&&& /*可以设置快捷键如ctrl+e,这样能很方便的在资源管理器打开对应的文件,并进行tortoiseSVN的相关操作*/
X:\Progra~1\TortoiseSVN\bin\TortoiseProc.exe /command:log /path:% /notempfile /closeonend
&&&&&&& /*使用前注意更改对应的bin安装路径*/
&&&&&&& /*作用是直接查看当前文件的svn log*/
&&&&&&& /*可以设置快捷键如ctrl+l*/
X:\Progra~1\TortoiseSVN\bin\TortoiseProc.exe /command:diff /path:% /notempfile /closeonend
&&&&&&& /*使用前注意更改对应的bin安装路径*/
&&&&&&& /*作用是直接查看当前文件和基准版本的比较*/
&&&&&&& /*可以设置快捷键如ctrl+d*/
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& Source Insight中的文件过滤器
遇到在新建工程的时候,需要加入一些除了.c .h 等之外的文件,比如.s,.scf ,Makefile和ReleaseNotes等文件,而每次新建工程的时候,即使取消了shown only known document types,和在点击Add All之后选择了Recusively add lower sub-directories ,也还是不能正常识别这类文件,也就不能加入进工程,只能我们自己手动双击添加到工程中,如果文件少还无所谓,但是包含了很多子文件夹的大工程,这样实在不可行。
百度了下,终于发现解决办法了:
打开Source Insight,在新建工程之前,进入
Options -& Document Options... Alt-T&&& -& 点击Document Type的下拉框,然后选择Make File,在右边的File Filter中,在原先的*.mak后面加上一个分号,即多个不同过滤规则以分号间隔开,再加上*makefile,变成 *.*makefile,并且选中Include when adding to projects,这样,以后再新建工程的时候,就可以识别makefile或Makefile了(好像此处Source Insight并不区分大小写)。
类似的原理,给其他你想要加入的不同的类型的文件,分别加入到原先的一些文件类型后面,注意要用分号隔开,或者直接新建一个文件类型,然后写上对应的顾虑规则,比如
点击 Add Type,填入新文件类型的名字Scatter File,File Filter中写上*.scf,注意再选中下面的Include when adding to projects,这样就建立了一个新的文件类型, 以后新建工程加入文件时候,系统就能够识别后缀是scf的文件了。
--------------------
中文注释乱码解决方法:
用记事本打开源文件,然后,选择文件-&另存为,编码选为”ANSI“
字体的调整:
Source Insight 菜单栏选择Options-&Document Options(或者直接Alt+T),打开Document Options对话框,点击Screen Fonts,在新打开的字体对话框中设置一下就OK啦
Alt+F12可以将字体换成等宽的(Fixedsys)
当然感兴趣的,还可以对你新建立的文件类型进行一些格式化设置。包括Parsing,Tab等等设置。
本文已收录于以下专栏:
相关文章推荐
0x00 前言在接手一个新项目的时候由于别人的代码对于自己来说太过于陌生,因此使用一个代码组织良好的编辑器来看代码至关重要,毫无例外,SI是比较好的选择,但是老外的东西对中文支持就是不好。大多是情况下...
souce insight macro自动创建代码
Source Insight 的基本使用之查看 Android Source,用了一个多小时,果然是小白,也顺便把这篇关于使用 Source Insight 时,出现 Symbol not...
1 sourceinsight screen font 的默认字体是Verdana的,它是一直变宽字体。在Document style中可以将字体改为定宽的Courier 2
勾掉indent Op...
(1)设置字体大小;设置Tab为4个空格。
长时间看程序谁也受不了,所以设置大号字体是必须的。
在Option->Docutment Option里设置Screen Fonts和Tab W...
Source Insight中文注释为乱码解决办法
干货:Source Insight 4 的解决办法(source insight 3.5 及以下版本就到其他地方看看吧)
【解决办法】:
菜单栏中...
搞定SourceInsight的半个汉字的问题
“SourceInsight是一个面向项目开发的程序编辑器和代码浏览器,它拥有内置的对C/C++, C#和Java等程序的分析。SourceIns...
上传源码时最好把空格行去掉,以前介绍了使用notepad++,现在发现,习惯用source insight的人士也可以很easy的去掉了:
Options->Perferences->Files->...
他的最新文章
讲师:王禹华
讲师:宋宝华
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)Source Insight 4.0 文件类型、编码格式、tab转空格、tab键自动补全设置。。。/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的工程,可以定义一种文件类型*.*。
*.*.*.*.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即可,或者可以在这里直接下载:
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中文注释乱码问题的解决方案 - ccf的专栏 - 博客频道 - CSDN.NEThttp://blog.csdn.net/ccf/article/details/8987759
------------------------------------------------
Source Insight常用的快捷键:
Ctrl+= :Jump to definitionAlt+/ :Look up referenceF3 : search backwardF4 : search forwardF5: go to LineF7 :Look up symbolsF8 :Look up local symbolsF9 :Ident leftF10 :Ident rightAlt+, :Jump backwordAlt+. : Jump forwardShift+F3 : search the word under cusor backwardShift+F4 : search the word under cusor forwardF12 : incremental searchShift+Ctrl+f: search in projectshift+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 prog you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F 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 * alo if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
USA */macro SuperBackspace(){
hwnd = GetCurrentWnd();
hbuf = GetCurrentBuf();
if (hbuf == 0)
// 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);
// 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)
// 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);
num = 1; // del one char
if (ipos &= 1) {
// process Chinese character
count = 0;
while (AsciiFromChar(text[i - 1]) &= 160) {
i = i - 1;
count = count + 1;
if (i == 0)
if (count & 0) {
// I think it might be a two-byte character
// 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)
// 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);}
*============================ SuperBackspace.em ============================&
附: Source Insight快捷键大全
: Ctrl+Alt+Space
恰好复制该位置右边的该行的字符
: Ctrl+Shift+K
复制到剪贴板
: Ctrl+Del
剪切该位置右边的该行的字符
剪切到剪贴板
: Ctrl+Shift+X
剪切一个字
: Ctrl+Enter
从剪切板粘贴
: Ctrl+Ins
重复上一个动作
智能重命名
关闭所有文件
: Ctrl+Shift+W
转到下一个文件
: Ctrl+Shift+N
重新装载文件
: Ctrl+Shift+O
: Ctrl+Shift+S
显示文件状态
: Shift+F10
激活语法窗口
回到该行的开始
回到选择的开始
: Ctrl+Alt+[
到块的下面
: Ctrl+Shift+]
到块的上面
: Ctrl+Shift+[
到文件底部
: Ctrl+End, Ctrl+(KeyPad) End
到窗口底部
: (KeyPad) End (小键盘的END)
到一行的尾部
到选择部分的尾部
: Ctrl+Alt+]
到下一个函数
: 小键盘 +
上一个函数
: Alt+,, Thumb 1 Click
后退到索引
: Alt+., Thumb 2 Click
: F5, Ctrl+G
转到下一个修改
: Alt+(KeyPad) +
转到下一个链接
: Shift+F9, Ctrl+Shift+L
回到前一个修改
: Alt+(KeyPad) -
跳到连接(就是语法串口列表的地方)
: PgDn, (KeyPad) PgDn
: PgUp, (KeyPad) PgUp
向上滚动半屏
: Ctrl+PgDn, Ctrl+(KeyPad) PgDn, (KeyPad) *
向下滚动半屏
: Ctrl+PgUp, Ctrl+(KeyPad) PgUp, (KeyPad) /
: Alt+Left
向上滚动一行
: Alt+Down
向下滚动一行
: Alt+Right
选择当前位置的左边一个字符
: Shift+Left
选择当前位置右边一个字符
: Shift+Right
: Shift+F6
从当前行其开始向下选择
: Shift+Down
从当前行其开始向上选择
: Shift+Up
: Shift+PgDn, Shift+(KeyPad) PgDn
: Shift+PgUp, Shift+(KeyPad) PgUp
选择句子(直到遇到一个 . 为止)
: Shift+F7, Ctrl+.
从当前位置选择到文件结束
: Ctrl+Shift+End
从当前位置选择到行结束
: Shift+End
从当前位置选择到行的开始
: Shift+Home
从当前位置选择到文件顶部
: Ctrl+Shift+Home
选择一个单词
: Shift+F5
选择左边单词
: Ctrl+Shift+Left
选择右边单词
: Ctrl+Shift+Right
到文件顶部
: Ctrl+Home, Ctrl+(KeyPad) Home
到窗口顶部
: (KeyPad) Home
到单词左边(也就是到一个单词的开始)
: Ctrl+Left
到单词右边(到该单词的结束)
: Ctrl+Right
排列语法窗口(有三种排列方式分别按1,2,3次)
: Alt+Shift+R
: Alt+Shift+S
增量搜索(当用Ctrl + F 搜索,然后按F12就会转到下一个匹配)
: Ctrl+Shift+H
在多个文件中搜索
: Ctrl+Shift+F
搜索选择的(比如选择了一个单词,shift+F4将搜索下一个)
: Shift+F4
浏览本地语法(弹出该文件语法列表窗口,如果你光标放到一个变量/函数等,那么列出本文件该变量/函数等的信息)
浏览工程语法
: F7, Alt+G
跳到基本类型(即跳到原型)
跳到定义出(也就是声明)
: Ctrl+=, Ctrl+L Click (select), Ctrl+Double L Click
语法信息(弹出该语法的信息)
: Alt+/, Ctrl+R Click (select)
高亮当前单词
: Shift+F8
语法窗口(隐藏/显示语法窗口)
: Alt+F6, Ctrl+F4
最后一个窗口
: Ctrl+Tab, Ctrl+Shift+Tab
阅读(...) 评论()

我要回帖

更多关于 sourceinsight 添加宏 的文章

 

随机推荐