Ⅰ. 插件描述
Improved `gf` for JavaScript.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'hotoo/jsgf-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'hotoo/jsgf-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'hotoo/jsgf-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/hotoo/jsgf.vim
Ⅳ. 文档说明
# JSGF: improved gf for JavaScript
This plugin improves Vim's gf command when navigating JavaScript imports.
Support:
- CommonJS (node_modules, package.json:main, /index.<supported suffixes>)
- Vue.js (*.vue)
- JSON (*.json)
- React (*.jsx)
- TypeScript (.ts, .tsx)
Installation
Vundle:
Plugin 'hotoo/jsgf.vim'Usage
gfin normal mode: goto file in current buffer.<C-w>gfin normal mode: open file in new tab.
Document
:help gfOptions
Maybe you need autochdir option in .vimrc
set autochdirg:jsgf_option_open
Open file method, default is 'edit', you can use 'new', 'tabnew', or 'vnew'.
let g:jsgf_option_open = 'vnew'Test
vim ./test/jsgf.test.js and gf, <Ctrl-o> to test.