Ⅰ. 插件描述
vim plugin for easy ctags and cscope handling in a separate directoryⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'basilgor/autotags'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'basilgor/autotags'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'basilgor/autotags'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/basilgor/vim-autotags
Ⅳ. 文档说明
This script is a wrapper for ctags and cscope, so tags for all languages
supported by ctags can be build (cscope is additionally used for C/C++).
Features:
- No configuration needed
- Build/rebuild index for project with a single key stroke
- Tags are loaded then automatically when a file is opened anywhere in project tree
- Tags are stored in a separate directory and don't clog you project tree
- Extra directories (like library source or includes) can be added with a single key stroke too
Put autotags.vim in your ~/.vim/plugin directory, open source code and
press F4 (map AutotagsUpdate to change it).
You can reindex sources by pressing F4 again.
To build and load additional tags for another directory (i.e. external
project or library code you want to navigate to) press F3 (or map
AutotagsAdd).
Script builds and loads ctags and cscope databases via a single command.
All ctags and cscope files are stored in separate directory ~/.autotags by
- You can set it via
let g:autotagsdir = $HOME."/boo"
Project root directory will be asked when indexing new project. After that
tags will be loaded automatically when source files somewhere in project
tree are opened (if path contains project root).
Exact tags location:
~/.autotags/byhash/<source dir name hash>/<ctags and cscope files>
Also origin symlink points back to source dir
~/.autotags/byhash/<source dir name hash>/origin
include_* symlinks point to additional tags for external directories
~/.autotags/byhash/<source dir name hash>/include_*
Tags for non-existing source directories are removed automatically
(checked at startup)
Also ctags file ~/.autotags/global_tags is built for /usr/include once
Platforms:
unix, cygwin
Dependencies:
ctags and cscope
md5sum
cscope_maps.vim plugin is recommended