不多说,阅读代码利器。

一、修改背景颜色

使用淡绿色更护眼(听说而已),菜单“选项”>>“属性”,使用自己喜欢的颜色吧。我的淡绿色RGB是181,236,207

二、行号,空格替换tabs,智能换行

三、解决source insight 中文间距的方法

默认情况下,往Source Insight里输入中文,字间距相当的大,要解决这个问题,具体设置如下:

1、Options->Style Properties

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

四、代码在source insight 中会出现不对齐的现象

  代码对齐对不齐和Editor(就是你使用的文本编辑器,UE也好,SI也好,VC内嵌的也好)的设置,Font(字体)都有关系;一般我们常用的Coding字体就是Courier new啊,VC好像默认就是的吧,我已经记不清除了我是一直在VC里面用Courier New的。每个字符的宽度是一样的,这和字符的种类有关系。

  但是Source Insight 的默认字体是 Verdana Regular 8号 (No bold/Italic);Verdana 这种字体不是每个字符等宽的,所以VC里面看起来整齐的代码拿到SI看起来有点奇怪,尤其是有些行是用tab缩进的,有些行是用space缩进的时候,在VC看起来都一样(比如设置了1tab == 4 space),在SI看起来就会差着;在SI里面编辑现有的代码有时候也有点麻烦;

  解决方法可以把SI的字符格式换成Courier New的,在Options - Document Options里面设置Screen Fonts一开始在SI里面看起来有些奇怪;因为大部分字体都是Courier new了。但是这时候从其他地方转过来的代码有可能就对得齐了。

五、解决backspace、Delet、上下左右键等中文乱码问题

  默认情况下,要按两下删除键才能删除一个中文,按一下的话,会有乱码。解决的方法是,在preject打开Base工程,打开文件Utils.em,把下面的代码拷到后面。并在options->Key Assignment为几个macro分配键。

/*======================================================================

1、BackSpace后退键

======================================================================*/

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;

}

/*======================================================================

2、删除键——SuperDelete.em

======================================================================*/

macro SuperDelete()

{

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 " "

SuperDelete(1);

stop;

}

// 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

stop;

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);

stop;

}

num = 1; // del one char

if (ipos > 0) {

// 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) || count == 0) && (ipos < len-1))

ipos = ipos + 1;    // adjust cursor position

}

// keeping safe

if (ipos - num < 0)

num = ipos;

}

else {

i = ipos;

count = 0;

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

i = i + 1;

count = count + 1;

if(i == len-1)

break;

}

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);

stop;

}

/*======================================================================

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)

{

i=pos;

count=0;

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

{

i = i - 1;

count = count+1;

if(i == 0)

break;

}

if((count/2)*2==count|| count==0)

return 0;

else

return 1;

}

return 0;

}

macro moveleft()

{

hwnd = GetCurrentWnd();

hbuf = GetCurrentBuf();

if (hbuf == 0)

stop;   // empty buffer

ln = GetBufLnCur(hbuf);

ipos = GetWndSelIchFirst(hwnd);

if(GetBufSelText(hbuf) != "" || (ipos == 0 && ln == 0))   // 第0行或者是选中文字,则不移动

{

SetBufIns(hbuf, ln, ipos);

stop;

}

if(ipos == 0)

{

preLine = GetBufLine(hbuf, ln-1);

SetBufIns(hBuf, ln-1, strlen(preLine)-1);

}

else

{

SetBufIns(hBuf, ln, ipos-1);

}

}

macro SuperCursorLeft()

{

moveleft();

if(IsComplexCharacter())

moveleft();

}

/*======================================================================

4、右移键——SuperCursorRight.em

======================================================================*/

macro moveRight()

{

hwnd = GetCurrentWnd();

hbuf = GetCurrentBuf();

if (hbuf == 0)

stop;   // 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);

stop;

}

if(ipos == strlen(text)-1 && ln == totalLn-1) // 末行

stop;

if(ipos == strlen(text))

{

SetBufIns(hBuf, ln+1, 0);

}

else

{

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.ichLim;

ln = selRec.lnLast;

text = GetBufLine(hbuf, ln);

len = strlen(text);

if(len == 0 || len < pos)

return 1;

//Msg("@len@;@pos@;");

if(pos > 0)

{

i=pos;

count=0;

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

{

i = i - 1;

count = count+1;

if(i == 0)

break;

}

if((count/2)*2==count|| count==0)

return 0;

else

return 1;

}

return 0;

}

macro shiftMoveRight()

{

hwnd = GetCurrentWnd();

hbuf = GetCurrentBuf();

if (hbuf == 0)

stop;

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)

stop;

selRec.lnLast = selRec.lnLast + 1;

selRec.ichLim = 1;

SetWndSel(hwnd, selRec);

if(IsShiftRightComplexCharacter())

shiftMoveRight();

stop;

}

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.ichFirst;

ln = selRec.lnFirst;

text = GetBufLine(hbuf, ln);

len = strlen(text);

if(len == 0 || len < pos)

return 1;

//Msg("@len@;@pos@;");

if(pos > 0)

{

i=pos;

count=0;

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

{

i = i - 1;

count = count+1;

if(i == 0)

break;

}

if((count/2)*2==count|| count==0)

return 0;

else

return 1;

}

return 0;

}

macro shiftMoveLeft()

{

hwnd = GetCurrentWnd();

hbuf = GetCurrentBuf();

if (hbuf == 0)

stop;

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)

stop;

selRec.lnFirst = selRec.lnFirst - 1;

selRec.ichFirst = GetBufLineLength(hbuf, selRec.lnFirst)-1;

SetWndSel(hwnd, selRec);

if(IsShiftLeftComplexCharacter())

shiftMoveLeft();

stop;

}

selRec.ichFirst = selRec.ichFirst-1;

SetWndSel(hwnd, selRec);

}

macro SuperShiftCursorLeft()

{

if(IsComplexCharacter())

SuperCursorLeft();

shiftMoveLeft();

if(IsShiftLeftComplexCharacter())

shiftMoveLeft();

}

/*---END---*/

【工具篇】source Insight的更多相关文章

  1. AStyle代码格式工具在source insight中的使用

    一.AStyle下载路径 Astyle为开源项目,支持C/C++和java的代码格式化 Home Page: http://astyle.sourceforge.net/ Project Page:  ...

  2. (工具)source insight高速增加时间代码

    这篇文章是程序代码更改由其他用户. 不是原厂原装,例如下列总结,使用作为个人笔记. (1)打开projectbase.打开文件Utils.em,插入下面代码: //插入时间 macro MonthTo ...

  3. 给Source Insight做个外挂系列之一--发现Source Insight

    一提到外挂程序,大家肯定都不陌生,QQ就有很多个版本的去广告外挂,很多游戏也有用于扩展功能或者作弊的工具,其中很多也是以外挂的形式提供的.外挂和插件的区别在于插件通常依赖于程序的支持,如果程序不支持插 ...

  4. Source Insight 插件

    一提到外挂程序,大家肯定都不陌生,QQ就有很多个版本的去广告外挂,很多游戏也有用于扩展功能或者作弊的工具,其中很多也是以外挂的形式提供的.外挂和插件的区别在于插件通常依赖于程序的支持,如果程序不支持插 ...

  5. Source Insight 4.0安装使用教程

    一.说明 Source Insight是什么:Source Insight是一款代码编缉.浏览.分析工具. Source Insight与文本编缉器有什么区别:Notepad++等文本编缉器也可以编缉 ...

  6. 【工利其器】必会工具之(一)Source Insight篇

    前言         “Source Insight(以下简称SI)是世界上最好的编辑器”,说这句话不知道会不会出门被打呢?-_- 中国古话说得好,“文无第一,武无第二”,所以不敢说SI是最好的,但是 ...

  7. 代码阅读工具:Source Navigator和Source Insight

    (摘自http://www.cnblogs.com/yc_sunniwell/archive/2010/08/25/1808322.html) 一.Source Insight实用技巧: Source ...

  8. Source Insight 中使用 AStyle 代码格式工具

    Source Insight 中使用 AStyle 代码格式工具 彭会锋 2015-05-19 23:26:32     Source Insight是较好的代码阅读和编辑工具,不过source in ...

  9. Source insight添加工具自动排版

    当在网上找了一些别人的程序拿来学习,用Source insight来看时,会不会因为代码太乱看了义愤填膺呢? 有很多集成的开发环境可以自动排版,但source insight却不行!不过,有工具和配置 ...

随机推荐

  1. JavaScript高级程序设计45.pdf

    客户区坐标位置 clientX和clientY保存着鼠标指针在视口中的水平位置坐标和垂直位置坐标(显示出页面的部分叫做客户区,坐标信息不包括页面的滚动距离) var div=document.getE ...

  2. EJB (not bound)

    问题: 在代码实在找不到错误的情况下,仍然报:XXXX not bound 问题产生过程: 通过下图方式创建的项目:EJBTest2_1 勾选下面两项,即可生成:EJBTest2_1EJB 和 EJB ...

  3. 蔡勒(Zeller)公式

    蔡勒(Zeller)公式,是一个计算星期的公式,随便给一个日期,就能用这个公式推算出是星期几. W =[ [c/4] - 2c + y + [y/4] + [13 * (m+1) / 5] + d - ...

  4. 数据库分页--MySQL数据库

    关于实现MySQL分页的最简单的方法就是利用mysql数据库的limit函数:limit [offset,] rows SELECT * FROM 表名称 LIMIT M,N limit 子句可以被用 ...

  5. Why do we need smart pointer and how to implement it.

    Here are two simple questions. Problem A #include <string> include <iostream> using name ...

  6. Java的垃圾回收概述

    Java语言建立了垃圾收集机制,即GC,用以跟踪正在使用的对象和发现并回收不再使用的对象,垃圾清理势在必行,以下讲述java垃圾收集算法. 1.Java垃圾收集算法的核心思想 Java语言建立了垃圾收 ...

  7. hdoj 1787 GCD Again【欧拉函数】

    GCD Again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

  8. C++ thread函数使用

    #include <thread> #include <iostream> using namespace std; int shared_value = 0; void ch ...

  9. ios 利用Reveal来调试界面1 --模拟器(步骤详解)

    Reveal是一个程序界面调试工具,可以调试iOS apps和tvOS apps.使用Reveal,我们可以在开发时动态地查看和修改应用程序的界面.避免每次修改UI的时候都要重新运行程序.接下来按照规 ...

  10. 安装windows7、windows8.1提示无法创建新的分区

    有时候用原版系统镜像安装windows系统时,会提示“windows无法安装到这个磁盘.选中的磁盘采用GPT分区形式”,导致安装失败,下面就来讲解一下如何解决. 1.在系统提示无法安装的那一步,按住“ ...