首先要切換到程式所在目錄(最上層)(first, you change the current directory to the top of the src code
生成cscope.out檔案(create database of cscope
[xxx@xxx]$cscope -Rbkq
建立完後,使用vim開啟任一檔案(after creating DB, edit any of the src code.
按:(冒號)進入命令模式(press ':' to enter vim command mode
:cs find f filename (找尋某file) (find file with name 'filename'
:cs f s string (找尋某string) (find symbol with name 'string'
:cs f t text (找尋某text)(find text with name 'text'
2011年3月24日 星期四
vim - linux editor
列一下常用的指令
command mode
:sp filename 開啟另一個檔案,視窗分割成左、右
:vsp filename 開啟另一個檔案,視窗分割成上、下
* 搜尋游標所在關鍵字
n 往後搜尋關鍵字
N 往前搜尋關鍵字
G 跳到文件末
1G 跳到文件首
/keyword 搜尋keyword
insert mode(輸入模式:在command mode按aiorR任一鍵,返回command mode
按Esc或ctrl + [ )
ctrl + n 輸入補齊
ctrl + p 輸入補齊
visual mode (選取模式:在command mode按v,接著移動游標)
= 將選取的程式碼進行自動排版
ref
1. 非常詳盡的介紹 http://plog.longwin.com.tw/my_note-unix/2010/05/31/vim-cheatsheet-ppt-learn-2010 (*)
2. 集錦 http://blog.vgod.tw/2009/12/08/vim-cheat-sheet-for-programmers/
3. game for fun http://blog.ijliao.info/archives/2005/09/08/1743/
command mode
:sp filename 開啟另一個檔案,視窗分割成左、右
:vsp filename 開啟另一個檔案,視窗分割成上、下
:m,ns/key1/key2/g 在第m~n行間,將key1取代成key2 (m,n不填時,只取代最近搜尋到的一筆)
:# 跳到第#行
* 搜尋游標所在關鍵字
n 往後搜尋關鍵字
N 往前搜尋關鍵字
G 跳到文件末
1G 跳到文件首
/keyword 搜尋keyword
insert mode(輸入模式:在command mode按aiorR任一鍵,返回command mode
按Esc或ctrl + [ )
ctrl + n 輸入補齊
ctrl + p 輸入補齊
visual mode (選取模式:在command mode按v,接著移動游標)
= 將選取的程式碼進行自動排版
ref
1. 非常詳盡的介紹 http://plog.longwin.com.tw/my_note-unix/2010/05/31/vim-cheatsheet-ppt-learn-2010 (*)
2. 集錦 http://blog.vgod.tw/2009/12/08/vim-cheat-sheet-for-programmers/
3. game for fun http://blog.ijliao.info/archives/2005/09/08/1743/
2011年3月19日 星期六
chrome extension list
列出比較常用的
- Proxy Switchy!
根據不同的瀏覽網頁(用keyword來篩選),選擇不同的連線方式(direct or 掛SOCK5 proxy)
ps 可以掛了SOCK5的 proxy來連,其餘使用直接連線
- rxPlurk (by 雷克斯)
嵌在瀏覽器上的一個icon,會顯示幾個plurk未讀訊息,用來讀plurk訊息
又不用另開一個新分頁
待補完...
滑鼠手勢,拖曳滑鼠右鍵,達成開新分頁、切換到左邊/右邊分頁的功能
瀏覽網頁時,在該頁面任意一處按右鍵即可縮址( ex goo.gl)- Proxy Switchy!
根據不同的瀏覽網頁(用keyword來篩選),選擇不同的連線方式(direct or 掛SOCK5 proxy)
ps 可以掛了SOCK5的 proxy來連,其餘使用直接連線
- rxPlurk (by 雷克斯)
嵌在瀏覽器上的一個icon,會顯示幾個plurk未讀訊息,用來讀plurk訊息
又不用另開一個新分頁
待補完...
訂閱:
文章 (Atom)