Ⅰ. 插件描述
text objects for the whitespaceⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'bruno-/vim-space-it-has-you'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'bruno-/vim-space-it-has-you'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'bruno-/vim-space-it-has-you'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/bruno-/vim-space
Ⅳ. 文档说明
# space.vim
Vim text objects for the whitespace.
Text objects
a<Space>"around whitespace", selects all the whitespace characters around
the cursor.<br/>
When invoked on an empty line, operator behaves
linewise by
selecting all the surrounding empty lines.
i<Space>"inner whitespace", selects all the whitespace characters around
the cursor, except the first char.<br/>
When invoked on an empty line, operator behaves
linewise by
selecting all the surrounding empty lines, except the first one.
Why?
The most common use would be to easily get rid of the excessive whitespace.
Options
To disable default mappings, add the following to vimrc:
let g:space_default_mappings = 0Example creating custom mappings for i<Ctrl-s> and a<Ctrl-s>:
omap <silent> i<C-s> <Plug>(inner_space)
xmap <silent> i<C-s> <Plug>(inner_space)
omap <silent> a<C-s> <Plug>(around_space)
xmap <silent> a<C-s> <Plug>(around_space)Also, you might find these single-key mappings useful:
omap <silent> <Space> <Plug>(inner_space)
xmap <silent> <Space> <Plug>(inner_space)Installation
- Vundle<br/>
Plugin 'bruno-/vim-space' - Pathogen<br/>
git clone git://github.com/bruno-/vim-space.git ~/.vim/bundle/vim-space