Skip to content

Latest commit

 

History

History
76 lines (53 loc) · 1.97 KB

README.md

File metadata and controls

76 lines (53 loc) · 1.97 KB

Closing Brackets

A dead-simple Vim plugin to automatically insert the closing bracket/brace/parenthesis based on Vim Tip #630. Requires Vim 7.0 or higher.

This plugin was written because the other solutions interfered with SCIM and were more complex than I needed.

Installation

Place the contents of this repo in your Vim runtime folder (~/.vim on *nix systems or %USERPROFILE%\vimfiles on Windows) or use your favorite Vim plugin manager.

Mappings

The following are insert-mode mappings provided by this plugin. ( may be replaced with [ or {. The cursor position is denoted by |.

Start Input Result
( (|)
() (|)
(<BS>
<C-v>( (|
(<Del> (|
|) ) )|
)| ) ))|
<C-v>) )|

There is additionally an extra mapping for {<CR>:

{
|
}

The opened line will be indented according to your settings.

This plugin does not attempt to autoinsert quotes or do any smart deletion of pairs.

License

As a collection of commands based on content from the Vim Tips wiki, this plugin is licensed under the Creative Commons Attribution-Share Alike License 3.0 (Unported) (CC-BY-SA).

Alternatives

The tip page has a list of plugins that offer more advanced functionality.