Search

7/28/2006

Introduction to Programming in C/C++ with Vim

Introduction to Programming in C/C++ with Vim
《用vim 寫程式快n 倍》
1. ctags
ctags是vim附代的工具, 可以讓從函式跳到該函式的定義處,
[/home/someuser/src]$ctags *
-R: Recurse into directories supplied on command line [no].
會在所在目錄下產生一個tags檔案,下面是檢索用的指令
control-] : 跳到指標關鍵字定義的位置
control-T : 可以用這個指令返回之前的位置

2.
set makeprg=gcc\ -o\ %<\ %
set errorformat=%f:%l:\%m
:make
:cl 列出所有錯誤
:cn 列出下一個錯誤
:cp 列出上一個錯誤

3.taglist
把taglist.txt放到~/.vim/doc
taglist.vim放到~/.vim/plugin
安裝完後
Tlist 打開Taglist視窗
c-w h, c-w l 可以在兩視窗互換
s Change the sort order of the tags (by name or by order)
Jump to the location where the tag under cursor is
defined.

Linux環境下的Socket編程

沒有留言: