Skip to content

kkga/auto-pairs.kak

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

auto-pairs.kak

Auto-paired characters for Kakoune.

When inserting an opening pair, auto-pairs always inserts the closing pair, unless when under a word character or preceded by a backslash, and for non nestable characters (such as apostrophes), when preceded by word characters.

Auto-pairing is also about pair navigation and editing (deleting existing pairs and formatting in pair). It can move in pair (▌), delete in pair (▌) and post pair ()▌, and pad in pair horizontally (␣▌␣) and vertically:

    …
    foobar {
        ▌
    }
    …

.

When inserting an auto-paired character, if the opening and closing characters are the same (such as double quote strings), auto-pairs will move right in pair "▌" and skip additional pairing post pair "▌.

Features

  • Auto-pairing
  • Vertical and horizontal padding
  • No sh call when typing

Dependencies

Installation

Add auto-pairs.kak to your autoload or source it manually.

require-module auto-pairs

Usage

Enable auto-pairs with auto-pairs-enable. Auto-paired characters can be changed via the auto_pairs option.

Surrounding pairs

By default, auto_pairs includes the following surrounding pairs:

Parenthesis block: ( )
Braces block: { }
Brackets block: [ ]
Double quote string: " "
Single quote string: ' '
Grave quote string: ` `
Double quotation mark: “ ”
Single quotation mark: ‘ ’
Double angle quotation mark: « »
Single angle quotation mark: ‹ ›

See also surround.kak and manual-indent.kak.

About

Auto-paired characters for Kakoune

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published