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: about 1 month ago
JSON representation
Snippets integration for Kakoune
- Host: GitHub
- URL: https://github.com/alexherbo2/snippet.kak
- Owner: alexherbo2
- License: unlicense
- Created: 2018-02-28T12:11:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-29T18:49:08.000Z (over 3 years ago)
- Last Synced: 2024-06-09T22:36:41.428Z (3 months ago)
- Topics: kakoune, plugin, snippets
- Homepage: https://kakoune.org
- Size: 74.2 KB
- Stars: 23
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING
Awesome Lists containing this project
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
}
```