Ⅰ. 插件描述
A ViM plugin for toggling background and color schemeⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'saghul/vim-colortoggle'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'saghul/vim-colortoggle'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'saghul/vim-colortoggle'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/saghul/vim-colortoggle
Ⅳ. 文档说明
Color toggling plugin for ViM
This plugin will allow you to toggle the background and colorscheme
together with a single key.
Installation
If you are using pathogen:
git clone https://github.com/saghul/vim-colortoggle.git ~/.vim/bundle/vim-colortoggle
If you are not using any plugins manager, just copy the folder plugin into your
~/.vim directory
Usage
Define global variables with your default background choice and color
schemes for dark and light backgrounds. Example:
let g:default_background_type = "dark"
let g:dark_colorscheme = "mustang"
let g:light_colorscheme = "pyte"
Then map the key you want to the ToggleBg function:
map <silent><F11> :ToggleBg<CR>
Extra
If you want the current value to be saved and restored you need to tell
viminfo to store global variables, by appending the ! symbol:
" viminfo options: http://vimdoc.sourceforge.net/htmldoc/usr_21.html#21.3
set viminfo='100,<50,s10,h,!
rviminfo
This is my first plugin for ViM, hope you like it :-)
Saúl Ibarra Corretgé <saghul@gmail.com>