---
title: "VIM ctags setup ack"
author: "夜鸣猪"
date: "2012-04-17T22:13:28Z"
tags: []
categories: ["编程语言"]
slug: "vim-ctags-setup-ack"
draft: false
lastmod: "2013-06-03T05:38:38Z"
id: 1488865
url: "https://hlee.iteye.com/blog/1488865"
---

[reference](http://hlee.iteye.com/blog/1780090)


```java
ctags --extra=+f --exclude=.git --exclude=log --exclude=coverage --exclude=public/assets -R *  /home/ken/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/*
```



```java
ctags --extra=+f --exclude=.git --exclude=log --exclude=coverage --exclude=public/assets -R * `rvm gemdir`/gems/*

```

<span style="color:red">再再更新：2012/10/8</span>
ubuntu下Ack 被覆盖问题

```java
sudo ln -s /usr/bin/ack-grep /usr/local/bin/ack
```

<span style="color:red">再更新：2012/07/28</span>
1. mac下ctags错误提示
2. 手册地质
<http://vim-taglist.sourceforge.net/manual.html>
<span style="color:red">严重更新</span>
MAC的用户，FuzzyFinder，推荐用peepopen去peepcode看或者github和textmate的command t很像
而且，brew install macvim很有必要，因为直接支持ruby运行
3. 

> highlight group not found: Normal


```ruby
#.vimrc
colorscheme default
```



```ruby

sudo aptitude remove vim
sudo aptitude install vim-rails
#in order to get vim-rails support

```


```sh

git clone git://github.com/astrails/dotvim.git
ln -sfn dotvim .vim
ln -sfn dotvim/vimrc .vimrc
cd .vim; make install

```


If you got error like below:

> 'Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded.'



```sh

sudo aptitude install exuberant-ctags

```



```ruby

sharpair:~$ /usr/bin/ctags
usage: ctags [-bfadtuwvx] [-f tagsfile] file ...
sharpair:~$ /usr/local/bin/ctags
ctags: No files specified. Try "ctags --help".
sharpair:~$ which ctags
/usr/local/bin/ctags
sharpair:~$ ctags
usage: ctags [-bfadtuwvx] [-f tagsfile] file ...
sharpair:~$ 

```


![](http://dl.iteye.com/upload/attachment/0071/4867/9497b8f1-1ea3-305d-b3c3-b51c4f201ff1.png)
When I try to open the taglist window, I am seeing the following error message. How do I fix this problem?


>    Taglist: Failed to generate tags for /my/path/to/file
>    ctags: illegal option -- -^@usage: ctags [-bfadtuwvx] [-f tagsfile] file ...


The taglist plugin will work only with the exuberant ctags tool. You cannot use the GNU ctags or the Unix ctags program with the taglist plugin. You will see an error message similar to the one shown above, if you try use a non-exuberant ctags program with Vim. To fix this problem, either add the exuberant ctags tool location to the PATH environment variable or set the Tlist_Ctags_Cmd variable. 

```ruby

#mac下面要brew一个新的ctags，如果提示旧的ctags有问题的话
hash -d ctags
```



```ruby

#如果要用ctrl ］来查gem里的方法，还需要ctags准备taglist
map <Leader>rt :!ctags --extra=+f --exclude=.git --exclude=log -R * `rvm gemdir`/gems/*<CR><CR>

map <silent><Leader>rt :!ctags --extra=+f --exclude=.git --exclude=log -R * `gem environment gemdir`/gems/*<CR><CR>
#只是查bundle的gem
map <silent> <Leader>rt :!bundle list --paths=true \| xargs ctags --extra=+f --exclude=.git --exclude=log -R *<CR><CR> 



```



```ruby

#.vimrc
 set fileformat=unix
 let Tlist_Ctags_Cmd='/usr/local/bin/ctags'

```


if you need make sure

```ruby

rvm use system

```


modify your ~/.vim/Makefile



```java

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "$home/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM 


```