先说下homebrew安装 ctags
http://brew.sh/index_zh-cn.html 中有说如何安装homebrew, 在terminal中运行如下命令
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
然后,依次如下命令
brew install vim
brew install macvim
brew install ctags
brew install cscope
但是貌似只有在本文件中可以找到tag,跨文件就失败。(说下ctags的操作,ctrl+] 是定位到函数定义,ctrl+T 返回,gd是跳到变量声明处)
参考了
https://gist.github.com/nazgob/1570678中
$ alias ctags="`brew --prefix`/bin/ctags"
(我觉得这个应该不起作用)
和
Pathogen的操作,如下:
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
然后在~/.vimrc中添加
execute pathogen#infect()
最后
cd ~/.vim/bundle && \
git clone git://github.com/tpope/vim-sensible.git
最终我的~/.vimrc文件中多了两行
let g:Tlist_Ctags_Cmd='/usr/local/bin/ctags'
execute pathogen#infect()
并且 ~/.profile文件中添加
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
目前可用ctags,还没有配置taglist,待续。