Source Insight的一點小技巧

來源:互聯網
上載者:User

一、選項設定部分

1.顯示行號

 

view菜單->Line Numbers

 

2.設定tab鍵與空格的關係

 

(1)Options -> Document Options -> Tab Width,設定為4

(2)Options -> Document Options -> 右下角 Editing Options 欄裡,把 Expand tabs 勾起來

 

3.字型設定

 

Options -> Document Options -> screen fonts,選擇你需要的字型

 

4.字元寬度

View -> Draft View,可以讓每個字元的寬度一致,快速鍵是 "Alt + F12"。這樣可以在不同的編輯器下開啟,代碼總是對齊的。

 

5.讓{ 和 } 不縮排:

 

Options -> Document Options -> Auto Indent -> Indent Open Brace/Indent Close Brace

 

6.恢複小鍵盤的“+,-,*,/”功能[1]

Options --> Key assignments,

(1)通過關鍵詞Scroll 找到Scroll Half Page Up,取消小鍵盤/;

(2)通過關鍵詞Scroll 找到Scroll Half Page Down取消小鍵盤*;

(3)通過關鍵詞Function找到Function Up,取消小鍵盤-;

(4)通過關鍵詞Function找到Function down,取消小鍵盤+。

 

7.啟用 ctrl+a 的全選功能[1]

Options --> Key assignments,

(1)通過關鍵詞save 找到save all,更改為ctrl+shift+a

(2)通過關鍵詞select找到select all, 更改為ctrl +a

 

8.去掉自動完成功能(PS:我挺喜歡這項功能的,提供給不喜歡這項功能的人來使用)[2]

(1)Options -> Preferences -> Typing卡 -> Auto Completion框,勾掉Use automatic symbol completion window(這裡是SIS的全域設定)

(2)Options -> Document Option -> Editing Options框中,勾掉Allow auto-complete(局部設定)

上面兩項必須全部勾選,才能啟用Auto Completion功能

 

 

二、提示部分

 

1.尋找變數的定義

按住"Ctrl", 再用滑鼠指向某個變數點擊一下,就能進入這個變數的定義。

 

2.高亮顯示與游標位置相同的所有單詞

"Shift+F8"

 

3.跳到某一行

"Ctrl + g"

 

4.快速鍵部分[2]

    Ctrl+= :       Jump to definition

    Ctrl+/ :       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

 

三、使用宏功能

    在編碼中,常常會到用到如下的功能:比如添加檔案頭、函數說明和宏定義等, 添加檔案名稱、函數名和當前日期等等。這些功能就可以通過宏檔案和功能表項目結合起來實現。

    3.1 構造宏檔案

    這裡不提供宏檔案例子,Source Insight 3.5 預設的目錄"我的文件/Source Insight/Projects/Base"中有一個宏檔案“utils.em”,大家可以直接使用它,或是對其進行增、刪、修。也可以去下載宏檔案(http://www.sourceinsight.com/public/macros/),假設下載的宏檔案名稱為“comment.em”

    3.2 將宏檔案和功能表項目結合起來[1]

    1. Project->Open Project... 開啟Base工程(該工程一般在"我的文件/Source Insight/Projects/Base"中);

    2. Project->Add and Remove Project Files... 加入下載來的宏檔案(即comment.em);

    3. Options->Menu Assignments 開啟Menu Assignments視窗, 在Command中輸入Macro, 選中要使用的宏, 添加到合適的菜單中。選擇的宏的名稱,即可來自預設的宏檔案“utils.em”,也可以來自新下載宏檔案“comment.em”。

    3.3 通過功能表項目來使用宏檔案

    在相應的源檔案中,點擊上面指定的菜單中功能表項目,即可完成相應的宏定義完成的功能,在原始碼中插入宏定義產生的東西,比如注釋。

 

參考:

[1]http://blog.csdn.net/flyyanqu/archive/2008/03/27/2222799.aspx

[2]http://apps.hi.baidu.com/share/detail/978468

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.