Source Insight 常用設置和快捷鍵大全

 
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的工程,可以定義一種文件類型*.*。
 
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,將Marco: 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個空格保持一致!)
 
------------------------------------------------
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,將Marco: 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 ============================ 
 
附: Source Insight快捷鍵大全

退出程序 : Alt+F4
重畫屏幕 : Ctrl+Alt+Space
完成語法 : Ctrl+E
複製一行 : Ctrl+K
恰好複製該位置右邊的該行的字符 : Ctrl+Shift+K
複製到剪貼板 : Ctrl+Del
剪切一行 : Ctrl+U
剪切該位置右邊的該行的字符 : Ctrl+;
剪切到剪貼板 : Ctrl+Shift+X
剪切一個字 : Ctrl+,
左邊縮進 : F9
右邊縮進 : F10
插入一行 : Ctrl+I
插入新行 : Ctrl+Enter
加入一行 : Ctrl+J
從剪切板粘貼 : Ctrl+Ins
粘貼一行 : Ctrl+P
重複上一個動作 : Ctrl+Y
重新編號 : Ctrl+R
重複輸入 : Ctrl+
替換 : Ctrl+H
智能重命名 : Ctrl+'
關閉文件 : Ctrl+W
關閉所有文件 : Ctrl+Shift+W
新建 : Ctrl+N
轉到下一個文件 : Ctrl+Shift+N
打開 : Ctrl+O
重新裝載文件 : Ctrl+Shift+O
另存爲 : Ctrl+Shift+S
顯示文件狀態 : Shift+F10
激活語法窗口 : Alt+L
回到該行的開始 : Home
回到選擇的開始 : Ctrl+Alt+[
到塊的下面 : Ctrl+Shift+]
到塊的上面 : Ctrl+Shift+[
書籤 : Ctrl+M
到文件底部 : Ctrl+End, Ctrl+(KeyPad) End
到窗口底部 : (KeyPad) End (小鍵盤的END)
到一行的尾部 : End
到選擇部分的尾部 : Ctrl+Alt+]
到下一個函數 : 小鍵盤 +
上一個函數 : 小鍵盤 -
後退 : Alt+,, Thumb 1 Click
後退到索引 : Alt+M
向前 : Alt+., Thumb 2 Click
轉到行 : F5, Ctrl+G
轉到下一個修改 : Alt+(KeyPad) +
轉到下一個鏈接 : Shift+F9, Ctrl+Shift+L
回到前一個修改 : Alt+(KeyPad) -
跳到連接(就是語法串口列表的地方) : Ctrl+L
跳到匹配 : Alt+]
下一頁 : PgDn, (KeyPad) PgDn
上一頁 : PgUp, (KeyPad) PgUp
向上滾動半屏 : Ctrl+PgDn, Ctrl+(KeyPad) PgDn, (KeyPad) *
向下滾動半屏 : Ctrl+PgUp, Ctrl+(KeyPad) PgUp, (KeyPad) /
左滾 : Alt+Left
向上滾動一行 : Alt+Down
向下滾動一行 : Alt+Up
右滾 : Alt+Right
選擇一塊 : Ctrl+-
選擇當前位置的左邊一個字符 : 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+F7
移除文件 : Alt+Shift+R
同步文件 : Alt+Shift+S
增量搜索(當用Ctrl + F 搜索,然後按F12就會轉到下一個匹配) : F12
替換文件 : Ctrl+Shift+H
向後搜索 : F3
在多個文件中搜索 : Ctrl+Shift+F
向前搜索 : F4
搜索選擇的(比如選擇了一個單詞,shift+F4將搜索下一個) : Shift+F4
搜索 : Ctrl+F
瀏覽本地語法(彈出該文件語法列表窗口,如果你光標放到一個變量/函數等,那麼列出本文件該變量/函數等的信息) : F8
瀏覽工程語法 : F7, Alt+G
跳到基本類型(即跳到原型) : Alt+0
跳到定義出(也就是聲明) : Ctrl+=, Ctrl+L Click (select), Ctrl+Double L Click
檢查引用 : Ctrl+/
語法信息(彈出該語法的信息) : Alt+/, Ctrl+R Click (select)
高亮當前單詞 : Shift+F8
語法窗口(隱藏/顯示語法窗口) : Alt+F8
關閉窗口 : Alt+F6, Ctrl+F4
最後一個窗口 : Ctrl+Tab, Ctrl+Shift+Tab

這是轉載網友的,很全,希望對大家有用,當然大家也可以自己自定文相應的快捷鍵,自己能操熟練和快捷就行!
發佈了17 篇原創文章 · 獲贊 4 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章