Ⅰ. 插件描述
[Vim] Enhance to increment candidates U have definedⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'nishigori/increment-activator'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'nishigori/increment-activator'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'nishigori/increment-activator'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/nishigori/increment-activator
Ⅳ. 文档说明
# IncrementActivator.vim
The [Vim] powerful increment plugin
The behavior is like <C-a>, <C-x> increment or decrement number by the default [Vim][]
It has been enhanced to allow increment the list that you have defined

Installation
Using dein.vim
call dein#add('nishigori/increment-activator')If you hope to do other approach, Please read more Documentation
Usage
Kay map
On Normal-mode, This plugin defines the following key mapping automatically <C-a> & <C-x>
If you don't want there key mappings, please write on vimrc
let g:increment_activator_no_default_key_mappings = 1
" e.g) Original key mappings
nmap ab <Plug>(increment-activator-increment)
nmap az <Plug>(increment-activator-decrement)If you want to be enabled to other mode(), please define map like this.
" Be enabled on insert-mode
imap <silent> <C-a> <Plug>(increment-activator-increment)
imap <silent> <C-x> <Plug>(increment-activator-decrement)Case of candidates for increment
The list will be generated in candidates patterns automatically
- no changes
- lower
- UPPER
- Capitalize
Default list defined by plugin
- yes/no
- on/off
- true/false
- weekday (sunday <-> monday <-> wednesday <- ... -> saturday <-> sunday)
- weekday-shorten (sun <-> mon <- ... -> sat <-> sun)
- month (january <-> february <- ... -> december <-> january)
- month-shorten (jan <-> feb <- ... -> dec <-> jan)
If you want to disable default candidates, puts on vimrc
let g:increment_activator_no_default_candidates = 1Customization
You can define original list for increment / decrement :)
Type of g:increment_activator_filetype_candidates is dict. each key is Vim's filetype.
The candidates for priority is -
- Current filetype (
&filetype) _key (_is special as apply to all filetypes)- number by default Vim
Example $MYVIMRC:
let g:increment_activator_filetype_candidates = {
\ '_' : [
\ ['Pythonista', 'PHPer', 'Gopher'],
\ ['ぬるぽ', 'ガッ'],
\ ['info', 'warning', 'notice', 'error'],
\ ],
\ 'cucumber': [
\ ['Given', 'And', 'When', 'Then'],
\ ],
\ 'erlang': [
\ ['module', 'export'],
\ [
\ 'is_alive', 'is_atom', 'is_binary', 'is_bitstring',
\ 'is_boolean', 'is_float', 'is_function',
\ 'is_integer', 'is_list', 'is_number',
\ 'is_pid', 'is_port', 'is_process_alive',
\ 'is_record', 'is_reference', 'is_tuple',
\ ],
\ ],
\ 'git-rebase-todo': [
\ ['pick', 'reword', 'edit', 'squash', 'fixup', 'exec'],
\ ],
\ 'go': [
\ ['true', 'false', 'iota', 'nil'],
\ ['byte', 'complex64', 'complex128'],
\ ['int', 'int8', 'int16', 'int32', 'int64'],
\ ['uint', 'uint8', 'uint16', 'uint32', 'uint64'],
\ ['float32', 'float64'],
\ ['interface', 'struct'],
\ ],
\ }More than, Please read Documentation