Ⅰ. 插件描述
Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'davidyorr/vim-es6-unused-imports'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'davidyorr/vim-es6-unused-imports'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'davidyorr/vim-es6-unused-imports'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/davidyorr/vim-es6-unused-imports
Ⅳ. 文档说明
vim-es6-unused-imports
This plugin highlights unused import statements in ECMAScript 6 code.
Usage
To check for unused import statements upon opening a javascript file, add this to your .vimrc:
autocmd BufWinEnter *.js execute "ES6ImportsHighlight"To also check for unused import statements on save, add this to your .vimrc:
autocmd BufWritePost *.js execute "ES6ImportsHighlight"To clear the highlighting, run the command ES6ImportsClear.
Options
Use the cterm options if you are running a terminal version of vim,
and use the gui options if you are running a GUI version of vim.
| Option | Default | Description |
|---|---|---|
g:es6_imports_cterm_fg_color | 'blue' | The foreground (ctermfg) color of the highlighted line. |
g:es6_imports_cterm_bg_color | 'darkred' | The background (ctermbg) color of the highlighted line. |
g:es6_imports_gui_fg_color | 'blue' | The foreground (guifg) color of the highlighted line. |
g:es6_imports_gui_bg_color | 'darkred' | The foreground (guibg) color of the highlighted line. |
g:es6_imports_excludes | [''] | An array of strings to exclude from the search. |