Ⅰ. 插件描述
Alternative ctags plugin for vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'pbrisbin/alt-ctags'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'pbrisbin/alt-ctags'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'pbrisbin/alt-ctags'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/pbrisbin/vim-alt-ctags
Ⅳ. 文档说明
# Alt Ctags
An alternative ctags plugin for vim. Automatically runs ctags
asynchronously upon opening any git-controlled file.
Installation
- Use [Vundle][]
- Add
Plugin "pbrisbin/vim-alt-ctags"
Options
| Setting | Default value | Notes |
|---|---|---|
| g:alt_ctags_loaded | unset | Setting this value prevents alt-ctags from loading at all |
| g:ctags_command | ctags -f '%f' -R | %f represents the output file |
| g:ctags_file | tags | |
| g:ctags_excludes | ['~'] | Ctags will not be run in these directories |
| b:ctags_command | unset | Buffer-specific override |
Notes
The %f in the ctags commands is required because we actually generate
to a temporary file then move it into place. This prevents intermittent
errors if vim attempts to access the file while it's being generated.
Examples
ftplugin/ruby.vim
if isdirectory('app')
" probably rails
let b:ctags_command = "ctags -f '%f' -R --exclude='*.js' --langmap='ruby:+.rake.builder.rjs' --languages=-javascript app lib vendor"
else
" typical ruby project
let b:ctags_command = "ctags -f '%f' -R lib"
endifftplugin/haskell.vim
let b:ctags_command = 'echo ":ctags %f" | ghci -v0 main.hs'