Ⅰ. 插件描述
Minimalistic Vim colorscheme manager on top of vim-colorscheme-switcherⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'taverius/vim-colorscheme-manager'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'taverius/vim-colorscheme-manager'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'taverius/vim-colorscheme-manager'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/taverius/vim-colorscheme-manager
Ⅳ. 文档说明
# Color scheme manager for Vim
An add-on for vim-colorscheme-switcher.
- Convenience functions for managing the colorscheme blacklist.
- Automatically load last used colorscheme upon starting vim or (optionally) loading a session.
- Store last used colorscheme and blacklist on file.
Author
Installation
Requires vim-colorscheme-switcher, must be installed separately.
Requires vim-misc, must be installed separately.
Manually
- Put all files under $VIM.
Pathogen
Install with the following command.
git clone https://github.com/Taverius/vim-colorscheme-manager ~/.vim/bundle/vim-colorscheme-manager
Dein.vim
Add the following configuration to your
.vimrc.call dein#add('Taverius/vim-colorscheme-manager')- Install with
:call dein#install().
vim-plug
Add the following configuration to your
.vimrc.Plug 'Taverius/vim-colorscheme-manager'- Install with
:PlugInstall.
Commands
The :BlacklistAddColorScheme command
Blacklist the current colorscheme and cycle forwards or backwards once. See g:colorscheme_manager_blacklist_direction below.
Optionally, takes a colorscheme name as an argument, and operates on that instead of the current one.
The :BlacklistRemColorScheme command
Remove the current colorscheme from the blacklist.
Optionally, takes a colorscheme name as an argument, and operates on that instead of the current one.
The :BlacklistPruneColorScheme command
Removes non-existent (i.e. not in runtime path) colorschemes from blacklist.
The :SwitchToColorScheme command
Syntactic sugar for xolox#colorscheme_switcher#switch_to(colorscheme), takes a colorscheme name as argument.
Useful for switching to a colorscheme you just installed with Vundle/NeoBundle/etc, or to use as custom command for a colorscheme browser - for example, unite.vim with unite-colorscheme
Options
The plug-in should work out of the box, but you can change the configuration defaults if you want to change how the plug-in works.
The g:colorscheme_manager_define_mappings option
By default the plug-in maps the following keys in insert and normal mode:
F9adds the current colorscheme to the blacklistShift-F9removes the current colorscheme from the blacklist
To disable these mappings (e.g. because you're already using them for a different purpose) you can set the option g:colorscheme_manager_define_mappings to 0 (false) in your vimrc.
The g:colorscheme_manager_blacklist_direction option
By default the plug-in cycles forward one colorscheme when adding the current one to the blacklist.
If you set this variable to 0 (false), it will instead cycle backwards.
The g:colorscheme_manager_global_last option
By default the plug-in reads both blacklist and last colorscheme from file.
If you set this option to 1 (true) in your vimrc, a global variable will take precedence unless empty.
Together with vim sessions with the option to store global variables enabled, this allows you to have a different colorscheme for each vim session.
The g:ColorschemeManagerLast option
This option is a string specifying the last the last used colorscheme.
It will be written to by the plug-in if g:colorscheme_manager_global_last is 1 (true).
If sessionoptions contains globals, :mksession will store this variable in the session file.
The g:colorscheme_manager_file option
The filename the plug-in will write its persistence data to.
Defaults to:
~/vimfiles/.colorschemeon windows.~/.vim/.colorschemeeverywhere else.
Set this to your preferred value in your vimrc to override the location.
License
Copyright (c) Leonardo Valeri Manera. Distributed under the same terms as Vim itself. See :help license.