Ⅰ. 插件描述
Instant documentation for HTML, CSS, JavaScript, jQuery, PHP and more in VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'stephenmckinney/vim-dochub'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'stephenmckinney/vim-dochub'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'stephenmckinney/vim-dochub'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/stephenmckinney/vim-dochub
Ⅳ. 文档说明
# dochub.vim
Quickly searches documentation from DocHub.io for:
- CSS
- DOM
- HTML
- JavaScript
- JQuery
- PHP
- Python
Installation
To install using pathogen.vim:
cd ~/.vim/bundle
git clone git://github.com/stephenmckinney/vim-dochub.git
To install using neobundle.vim:
NeoBundle 'stephenmckinney/vim-dochub'
To install using vundle:
Bundle 'stephenmckinney/vim-dochub'
Usage
dochub.vim is enabled by filetype. While editing a supported file,
simply place the cursor over a class, property, or method and type JJ.
The plugin will then open a new tab in your browser (or a new instance of
the browser) to the related docs. That's it.
| Documentation | Vim Filetypes |
|---|---|
| CSS | css, scss |
| HTML | eruby, html, htmldjango |
| JavaScript | javascript |
| PHP | php |
| Python | python |
The wildcards are documentation for DOM and JQuery, since they aren't
associated to a filetype they have their own mapping:
JDfor DOM DocumentationJQfor JQuery Documentation
Configuration
By default, dochub.vim uses the open command for OS X or the
xdg-open
command for other OSes to look up the docs. You can easily change the command.
For example:
let g:dochub_command='gnome-open'
Furthermore you can choose your own mapping in the following way:
let g:dochub_mapping='<C-h>'
Other Documentation Plugins
- Ruby - vim-ruby-doc
- Ruby - ri.vim
Credit
This plugin started as a fork of vim-jquery-doc, but became it's own thing.
License
Copyright (c) Steve McKinney. Distributed under the same terms as Vim itself. See :help license.