Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/alexherbo2/snippet.kak

Snippets integration for Kakoune
https://github.com/alexherbo2/snippet.kak

kakoune plugin snippets

Last synced: 28 days ago
JSON representation

Snippets integration for Kakoune

Lists

README

        

# snippets.kak

[Snippets] integration for [Kakoune].

[Snippets]: https://github.com/alexherbo2/snippets
[Kakoune]: https://kakoune.org

## Dependencies

- [Snippets]
- [jq]
- [kakoune.cr]
- [execute-key.kak]
- [phantom.kak]

[jq]: https://stedolan.github.io/jq/
[kakoune.cr]: https://github.com/alexherbo2/kakoune.cr
[execute-key.kak]: https://github.com/alexherbo2/execute-key.kak
[phantom.kak]: https://github.com/alexherbo2/phantom.kak

## Installation

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

``` kak
require-module snippets
```

## Usage

Enable snippets with `snippets-enable`.

Type `/` to bring the snippets completions,
select a snippet in the list of completions and press Enter,
or directly Alt + Enter to insert a snippet.
You can quickly jump to the next placeholder with [phantom.kak].

## Configuration

**Example**

``` kak
# Options
set-option global snippets_scope global global/arrows global/bullets global/dashes global/math global/punctuation

# Mappings
# Create new snippets
map -docstring 'Edit snippets' global user / ': snippets-edit'

# Optional auto-pairs integration
map -docstring 'Expand snippets' global insert ': snippets-enter auto-pairs-insert-new-line'

# Hooks
# Indent snippets with tabs
hook global BufCreate '.+/\.?config/snippets/.+' %{
set-option buffer indentwidth 0
}
```