Ⅰ. 插件描述
vim plugin for javascript to go to fileⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'feix760/vim-javascript-gf'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'feix760/vim-javascript-gf'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'feix760/vim-javascript-gf'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/feix760/vim-javascript-gf
Ⅳ. 文档说明
vim-javascript-gf.vim
Tools to make Vim superb for developing with Node.js.
Tour
- Use
gfon paths or requires to open the same file Node.js would. - Use
gfonrequire(".")to open./index.js - Use
gfonrequire("./dir")to open./dir/index.js - Use
gfonrequire("./foo")to openfoo.js. - Use
gfonrequire("./package")and have it open package.json. - Use
gfonrequire("module")to open the module's main file (parsed for you frompackage.json). - Use
gfonrequire("module/lib/utils")and open files inside the module.
Installing
To install using Vundle:
" add this line to your .vimrc file
Plugin 'feix760/vim-javascript-gf.vim'
or:
git clone https://github.com/feix760/vim-javascript-gf.vim.git
cp -r vim-javascript-gf.vim/* ~/.vim/
Using
Open any JavaScript file inside a Node project and you're all set.
- Use
gfinsiderequire("...")to jump to source and module files.