vim-autotag


Ⅰ. 插件描述

Automatically discover and "properly" update ctags files on save

Ⅱ. 基本信息

创建日期:  2012-02-20
使用用户:  3
Github星:  1
插件作者:  Steve McKinney

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'stephenmckinney/vim-autotag'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'stephenmckinney/vim-autotag'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'stephenmckinney/vim-autotag'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/stephenmckinney/vim-autotag

Ⅳ. 文档说明

autotag.vim

If you use ctags to make tags files of your source, it's nice to be able to re-run ctags on a source file when you
save it.

However, using ctags -a will only change existing entries in a tags file or add new ones. It doesn't delete entries
that no longer exist. Should you delete an entity from your source file that's represented by an entry in a tags file,
that entry will remain after calling ctags -a.

This python function will do two things:

  1. It will search for a tags file starting in the directory where your source file resides and moving up a directory
  2. a time until it either finds one or runs out of directories to try.
  3. Should it find a tags file, it will then delete all entries in said tags file referencing the source file you've
  4. saved and then execute ctags -a on that source file using the relative path to the source file from the tags

file.

This way, every time you save a file, your tags file will be seamlessly updated.

Installation

Using pathogen.vim:

cd ~/.vim/bundle
git clone git://github.com/craigemery/vim-autotag.git

Or Using neobundle.vim:

Add to .vimrc

NeoBundle 'craigemery/vim-autotag'

Run:

vim +NeoBundleInstall +qa

Self-Promotion

Like autotag.vim? Follow the repository on
GitHub and vote for it on
vim.org. And if
you're feeling especially charitable, follow [craigemery] on
GitHub.

License

Copyright (c) Craig Emery. Distributed under the same terms as Vim itself.
See :help license.

添加新评论