previewtag


Ⅰ. 插件描述

preview the definition and switch it to a new window

Ⅱ. 基本信息

创建日期:  2008-05-12
使用用户:  1
Github星:  1
插件作者:  Danqi Wang

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

The script opens the definition of functions and variables in the preview window on demand and provides operations to close the preview window, delete the buffer in the preview window and switch the buffer in the preview window to a new window. Quite simple, but useful.

The script provides four commands:
Pshow: open the definition of the current word in the preview window
Pdelete: delete the buffer showing in the preview window
PshowORdelete: if the cursor is in preview window, delete the current buffer (like Pdelete); Otherwise open the definition of current word in preview window
Pswitch: if the preview window is open, close it and open the buffer in a new window

Vim also provides a "pclose" command to close the preview window, without deleting the buffer.

If you want to open the tag preview immediately when you put cursor on a word, please uncomment the last line of the script. However, I found automatically preview is kind of boresome, so I do not provide a switch of auto-preview in the script.

You can also refer to another tiny script autopreview at http://vim.sourceforge.net/scripts/script.php?script_id=2228.

Related vim docs:
:help ptag
:help previewwindow

添加新评论