https://github.com/tranvansang/vim-close-pair
A Vim plugin to find last opening brace and insert corresponding closing brace
https://github.com/tranvansang/vim-close-pair
braces vim vim-plugins
Last synced: 3 months ago
JSON representation
A Vim plugin to find last opening brace and insert corresponding closing brace
- Host: GitHub
- URL: https://github.com/tranvansang/vim-close-pair
- Owner: tranvansang
- Created: 2015-07-19T14:00:58.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-10-08T01:34:29.000Z (over 9 years ago)
- Last Synced: 2023-03-02T04:25:54.520Z (over 3 years ago)
- Topics: braces, vim, vim-plugins
- Language: VimL
- Size: 2.93 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Vim Close Pair
==============
A Vim plugin to find last opening brace and insert corresponding closing brace
Install
-------
* With [Vundle](https://github.com/VundleVim/Vundle.vi://github.com/VundleVim/Vundle.vim)
- Append `Plugin ‘tranvansang/vim-close-pair’` to your `.vimrc`
- Restart vim or run `:source ~/.vimrc`
- Run `:PluginInstall`
* Manual
git checkout https://github.com/tranvansang/vim-close-pair.git
cd vim-close-pair
mkdir -p ~/.vim/plugin
cp -f plugin/close-pair.vim ~/.vim/plugin/
mkdir -p ~/.vim/autoload
cp -f autoload/close-pair.vim ~/.vim/autoload/
Usage
-----
In insert mode, type `Ctrl-L`
- Text : `({[ [foo] bar (foo) bar`
- Result : `({[ [foo] bar (foo) bar]`
Options
-------
Set values here are the default
* Binding key. Becareful when set this option, because it is bound it insert mode and may caught trouble when typing.
Set empty(`’’`) to disable this plugin
```
let g:close_pair_key = ‘’
```
* Maximal number of lines to scan for opening braces.
Set `0` to disable this plugin, `-1` for unlimit (scan until first line)
This option is combined with `g:close_pair_characters_limit`.
Scanning will stop when any of both limits reached.
```
let g:close_pair_lines_limit = -1
```
* Maximal number of characters to scan.
Set `0` to disable this plugin, `-1` for unlimit (scan until first character in buffer)
This option is combined with `g:close_pair_lines_limit`.
Scanning will stop when any of both limits reached.
```
let g:close_pair_characters_limit = -1
```
* Just move cursor right if the closing brace is already inserted
```
let g:close_pair_ignore_if_matched = 1
```
Example:
- Text : `(|)` (`|`: cursor position)
- Result :
- When this option is enabled: `()|`
- When this options is disabled: `()|)`
NOTE
----
* This plugin parses only pairs in `matchpairs` option.
* For HTML tag, you should use system completion (``) for better effect.
Example:
- Text : `foo|` (`|` : cursor position)
- Type : ``
- Result : `foo|`