Ⅰ. 插件描述
Forge tag jumps so tag alternatives can populate the tagstack.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'idbrii/vim-tagimposter'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'idbrii/vim-tagimposter'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'idbrii/vim-tagimposter'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/idbrii/vim-tagimposter
Ⅳ. 文档说明
# vim-tagimposter
Forge tag jumps so tag alternatives can populate the tagstack.
Obsolete
Recent versions of vim have gettagstack and settagstack that are better
versions of the functionality provided by tagimposter. See vim/vim#3604.
For an example implementation, see
this commit in vim-racer.
About
Do you have a
LSP or other
magic that helps you jump to symbols? Are you frustrated that C-t doesn't
work with that magic? tagimposter will commit tag forgery for you!
Inspired by [jedi.vim's
g:jedi#use_tag_stack](https://github.com/davidhalter/jedi-vim/blob/4c430ed536b6484f7c63929a4426d64f981d994e/pythonx/jedi_vim.py#L319),
tagimposter pushes imposter tags onto the tagstack. Call:TagImposterAnticipateJump before your tag jumper, and you'll have full
native support (including C-t) without any key remapping.
Usage
Usage varies for each tag jumper and how you like to jump to tags. For example
with omnisharp-vim, **inftplugin/cs.vim**:
nnoremap <buffer> <Leader>jT :<C-u> TagImposterAnticipateJump <Bar> OmniSharpGotoDefinition<CR>
Now you can use <Leader>jT to jump to tags, <C-t> to jump back, and:pop/:tag to navigate up and down the stack. :tags will show your tags
prefixed with IMPOSTER_.
Differences from jedi
vim-jedi is just for python. tagimposter works with anything (but requires more setup).
Unlike jedi, tagimposter uses a permanent file (to avoid save/restoring
wildignore and tags) and can work for any tag jumps, but have weird looking
symbol names.