Skip to content

Commit

Permalink
vendor auto-pairs since it's missing on GitHub (?)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Jul 7, 2021
1 parent 128609e commit 8e1a0e3
Show file tree
Hide file tree
Showing 6 changed files with 446 additions and 13 deletions.
4 changes: 4 additions & 0 deletions dotfiles/kakoune.nix
Expand Up @@ -43,6 +43,10 @@ let
name = "kak-tree-grepper";
src = ../pkgs/kak-tree-grepper/rc;
})
(kakoune.mkPlugin {
name = "auto-pairs.kak";
src = ../vendor/auto-pairs.kak/rc;
})
];

colorAttrs = lib.mapAttrs (name: source:
Expand Down
13 changes: 0 additions & 13 deletions nix/sources.json
Expand Up @@ -12,19 +12,6 @@
"url": "https://github.com/greenfork/active-window.kak/archive/988db69cfbb88bd741d089bb43b0be551693e7c1.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"auto-pairs.kak": {
"branch": "fd735ec149ef0d9ca5f628a95b1e52858b5afbdc",
"description": "Kakoune extension to enable automatic closing of pairs",
"homepage": "https://kakoune.org",
"kakoune": "plugin",
"owner": "alexherbo2",
"repo": "auto-pairs.kak",
"rev": "fd735ec149ef0d9ca5f628a95b1e52858b5afbdc",
"sha256": "07795kv9njlnp6mckwv141ny2ns6wyf5r0dfjaxh9ngd105zgif1",
"type": "tarball",
"url": "https://github.com/alexherbo2/auto-pairs.kak/archive/fd735ec149ef0d9ca5f628a95b1e52858b5afbdc.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"comma": {
"branch": "master",
"description": null,
Expand Down
18 changes: 18 additions & 0 deletions vendor/auto-pairs.kak/CONTRIBUTING
@@ -0,0 +1,18 @@
The preferred way to contribute would be through GitHub pull requests,
as an alternative patches can be discussed on the IRC channel.

When contributing your first changes, please include an empty commit for
copyright waiver using the following message (replace 'John Doe' with
your name or nickname):

John Doe Copyright Waiver

I dedicate any and all copyright interest in this software to the
public domain. I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors. I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.

The command to create an empty commit from the command-line is:

git commit --allow-empty
71 changes: 71 additions & 0 deletions vendor/auto-pairs.kak/README.md
@@ -0,0 +1,71 @@
# 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

- [prelude.kak]

[prelude.kak]: https://github.com/alexherbo2/prelude.kak

## Installation

Add [`auto-pairs.kak`](rc/auto-pairs.kak) to your autoload or source it manually.

``` kak
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].

[Kakoune]: https://kakoune.org
[surround.kak]: https://github.com/alexherbo2/surround.kak
[manual-indent.kak]: https://github.com/alexherbo2/manual-indent.kak
24 changes: 24 additions & 0 deletions vendor/auto-pairs.kak/UNLICENSE
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org/>

0 comments on commit 8e1a0e3

Please sign in to comment.