Ⅰ. 插件描述
vim plugin that shows the current function/tag in the statuslineⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mgedmin/taghelper-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mgedmin/taghelper-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mgedmin/taghelper-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mgedmin/taghelper.vim
Ⅳ. 文档说明
Overview
.. image:: https://travis-ci.org/mgedmin/taghelper.vim.svg?branch=master
:target: https://travis-ci.org/mgedmin/taghelper.vim
Vim plugin to show the name of the current tag (usually function) in the status
line.
.. image:: doc/screenshot.png
:width: 734
:height: 475
:alt: screenshot
Inspired by Michal Vitecek's pythonhelper.vim_ and my chelper.vim_. Intended
to replace both of them.
Needs Vim 8.0.0251 or newer, built with Python support.
Supports multiple languages:
- Python
- C
- C++
- diff files
Doesn't actually use tags files -- instead it has its own hacky parsers.
.. _pythonhelper.vim: https://www.vim.org/scripts/script.php?script_id=435
.. _chelper.vim: https://github.com/mgedmin/chelper.vim
Installation
I suggest you use a plugin manager like vim-plug_::
Plug 'mgedmin/taghelper.vim'
.. _vim-plug: https://github.com/junegunn/vim-plug
Configuration
Add %{taghelper#curtag()} to your 'statusline', e.g. ::
set statusline=%<%f %h%m%r %1%{taghelper#curtag()}%%=%-14.(%l,%c%V%) %P
Debugging
:call taghelper#showtags() will print all the tags detected in a source
- If you find that some code is parsed incorrectly (my parser is really
simple!), please file a bug on GitHub.
Copyright
taghelper.vim was written by Marius Gedminas <marius@gedmin.as>.
Licence: MIT.