vim tag&csope

http://timke.blog.163.com/blog/static/1015873062010283582408/

http://www.linuxidc.com/Linux/2011-04/34788.htm


ctags -R ; produce tags file

:set tags = tmp ; set tag file tmp

:0read tmp ;read tmp to current cursor start from line 0 of tmp file

:10,50 write tmp ; write line 10:50 to tmp file

:e tmp ;open tmp file

:vimgrep ; search

:help pattern ;to see how to use pattern for grep

ctrl+]; tag stack next

ctrl+t; tag stack prev

:find ; file search

:grep ; string search

:split ; split vim window

:vsplit; split win vertically


cscope:

vim -version|grep cscope ;检查当前vim版本是否支持cscope


建立索引:

find -name "*.h" -o -name "*.c" -o -name "*.cpp">cscope.files

cscope -bkq -i cscope.files


:cs add index_file

:cs find c; find calling function(调用它的函数)

              d; find called function(它调用的函数)

              e; egrep mode

              f; find this file

              g; find the definition

              i; find included file

              s; find the c symbol

              t; find string

:cs kill  : 终止一个 cscope 连接 (或终止所有 cscope 连接).
            用法   :cs kill {num|partial_name}
            要终止一个连接,需要给出连接号或者部分的连接名称。部分名称可以
            是数据库文件路径的任何一部分。所以要当心使用这个功能!
            如果给定的连接号是 -1,那么 所 有 的 cscope 连接都会被终止。

:cs reset : 重新初始化所有连接。
            用法    :cs reset

:cs show  : 显示当前的连接。
            用法    :cs show


cscope中的map指将cs find command 映射成某个键值

http://linux.chinaunix.net/techdoc/desktop/2006/07/07/935600.shtml



:res +N ;current win height add N size

:res -N ; cur win height decrease N size

:vertical res +N; width dir add N size

:vertical res -N; width dir decrease N size



其他几个链接:

http://wenku.baidu.com/view/a6148f6ba45177232f60a247.html

http://baike.baidu.com/view/1295125.htm

http://www.vimer.cn/2009/10/%E5%9C%A8vimgvim%E4%B8%AD%E4%BD%BF%E7%94%A8cscope.html

http://linux.chinaunix.net/techdoc/desktop/2006/07/07/935600.shtml

http://wenku.baidu.com/view/7cefbc8fcc22bcd126ff0c00.html


你可能感兴趣的:(String,function,File,kill,vim,search)