snippets.kak
Snippets integration for Kakoune.
Dependencies
Installation
Add snippets.kak
to your autoload or source it manually.
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
# 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<ret>'
# Optional auto-pairs integration
map -docstring 'Expand snippets' global insert <ret> '<a-;>: snippets-enter auto-pairs-insert-new-line<ret>'
# Hooks
# Indent snippets with tabs
hook global BufCreate '.+/\.?config/snippets/.+' %{
set-option buffer indentwidth 0
}