vim-smartbraces


Ⅰ. 插件描述

make { and } in Vim jump to the beginning respectively end of the current paragraph

Ⅱ. 基本信息

创建日期:  2016-05-23
使用用户:  4
Github星:  3
插件作者:  Enno

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'konfekt/vim-smartbraces'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'konfekt/vim-smartbraces'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'konfekt/vim-smartbraces'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/konfekt/vim-smartbraces

Ⅳ. 文档说明

This Vim plug-in makes

  • the keys { and } jump to the beginning respectively to the end of the current paragraph (instead of the first empty line before respectively after it, by default), and
  • the key ) jump to the end of the current sentence (instead of the start of the next sentence).

Setup

If you prefer to use different key combinations instead, say g{, g} and g), add

nmap  g{  <Plug>(smartbraces-OpenBrace)
nmap  g}  <Plug>(smartbraces-CloseBrace)
xmap  g{  <Plug>(smartbraces-OpenBrace)
xmap  g}  <Plug>(smartbraces-CloseBrace)
omap  g{  <Plug>(smartbraces-OpenBrace)
omap  g}  <Plug>(smartbraces-CloseBrace)

nmap  g)  <Plug>(smartbraces-CloseParenthesis)
xmap  g)  <Plug>(smartbraces-CloseParenthesis)
omap  g)  <Plug>(smartbraces-CloseParenthesis)

to your vimrc.

If you prefer that the keys { and }, as well as ), jump to the beginning respectively to the end of the current paragraph, respectively sentence, only inside spellchecked buffers, but work as usual otherwise, add

  let g:smartbraces_spell = 1

to your vimrc.

添加新评论