kakoune plugin for creating custom objects.
This plugin is not yet well tested. All feedback welcome.
Kakoune supports creating custom objects by pressing c
in the object mode. However, the entered object definitions are not saved and cannot be predefined. This plugin allows defining custom objects to appear in the object mode and to have them interact correctly with e.g. <a-i>
and <a-a>
.
Source custom-objects.kak
or install via plug.kak:
plug 'mreppen/custom-objects.kak'
The custom object format is the same as when pressing c
in the object mode (some restrictions). Add a custom object by using add-custom-object
. Keep in mind that inner scopes shadow outer scopes.
For example, to add an object for comments, run
add-custom-oject buffer "#" "\Q%opt{comment_block_begin}\E,\Q%opt{comment_block_end}\E" "comment"
- The object definition does not allow
=
or spaces. - Any
<
or>
characters must be replaced by<lt>
and<gt>
respectively.