This plugin implements many line-editing shortcuts in Kakoune, emulating Readline as closely as possible. See the readline(1) man page for explanations of what they do.
Suggested configuration:
# ~/.config/kak/kakrc
plug chambln/kakoune-readline config %{
map global insert <tab> <c-n>
map global insert <s-tab> <c-p>
map global insert <c-p> <up>
map global insert <c-n> <down>
hook global WinCreate .* readline-enable
}Use <a-tab> to insert a tab character; or omit the config clause if
you’d rather not use tab for completion.
Put a copy of or link to readline.kak anywhere within your
~/.config/kak/autoload/ directory.
Manually enable Readline mappings in the current window:
:readline-enable<ret>
Enable Readline mappings for the sh filetype:
# ~/.config/kak/kakrc
hook global WinSetOption filetype=sh %{
readline-enable
hook window WinSetOption filetype=.* readline-disable
}Always use Readline mappings:
# ~/.config/kak/kakrc
hook global WinCreate .* readline-enable- Implement
reverse-search-history (C-r)andforward-search-history (C-s). - Maybe respect
%opt{extra_word_chars}?
-
<c-a-h>kills two words backward if the cursor is exactly one character into the latter, e.g.one two t|hree fourbecomesone |hree fourwhere|represents the cursor. -
transpose-charandtranspose-wordtraverse line breaks. -
If the cursor is in the middle of the word,
delete-horizontal-spacedeletes whitespace after it. -
The
<c-u>(unix-line-discard) mapping overrides Kakoune’s default:<c-u> commit changes up to now as a single undo group