vim 实现 go to definition的功能

如:go to definition的功能,使用ctags

配置步骤:

1、创建vim ~/.vimrc

2、配置vim属性

set number

filetype plugin indent on

syntax on

set autoindent

set smartindent

set tabstop=2

set expandtab

set shiftwidth=2

set encoding=utf-8

set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1

set fileencoding=utf-8

set tags=/home/zt/server/trunk/tags

3、在需要创建tags的文件夹下,使用命令:ctags -R *

4、ctrl+] 转到定义

ctrl+t 返回