一.查看函数/变量定义
3.设置vim的tags搜索路径
编辑 ~/.vimrc文件,加上一行
#add this line to let the ctags search tags in the file "/opt/gtk/tags"
set tags+=/opt/gtk/tags
4.在gtk源码中将光标移动到想要查看的变量或函数上,按下Ctrl - ] 即可以查看其定义.Ctrl - T返回原文件
二.查看头文件
1.编辑 ~/.vimrc 文件,加上一行:
#add this line to let vim can search the header file in the directory "/opt/gtk/include" and "/opt/gtk/include/glib" ...
set path += /opt/gtk/include/,/opt/gtk/include/*
2.在vim中将光标移动到#include <xxx.h>头文件名中,按esc,gf(助记词:goto file),即可查看头文件.返回用:
:bp
或
:bf