https://github.com/chambln/kakoune-readline
Readline-style mappings for Kakoune.
https://github.com/chambln/kakoune-readline
kakoune plugin readline
Last synced: 5 months ago
JSON representation
Readline-style mappings for Kakoune.
- Host: GitHub
- URL: https://github.com/chambln/kakoune-readline
- Owner: chambln
- License: mit
- Created: 2019-09-19T12:31:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-19T02:55:16.000Z (almost 6 years ago)
- Last Synced: 2025-04-08T14:53:00.262Z (about 1 year ago)
- Topics: kakoune, plugin, readline
- Homepage:
- Size: 32.2 KB
- Stars: 14
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Readline-style mappings for Kakoune
This plugin implements many line-editing shortcuts in
[Kakoune](https://kakoune.org), emulating
[Readline](http://www.gnu.org/software/readline/) as
closely as possible. See the readline(1) man page for explanations of
what they do.
## Installation
### Using `plug.kak`
Suggested configuration:
``` kak
# ~/.config/kak/kakrc
plug chambln/kakoune-readline config %{
map global insert
map global insert
map global insert
map global insert
hook global WinCreate .* readline-enable
}
```
Use `` to insert a tab character; or omit the config clause if
you’d rather not use tab for completion.
### Manual
Put a copy of or link to `readline.kak` anywhere within your
`~/.config/kak/autoload/` directory.
### Usage
Manually enable Readline mappings in the current window:
:readline-enable
Enable Readline mappings for the `sh` filetype:
``` kak
# ~/.config/kak/kakrc
hook global WinSetOption filetype=sh %{
readline-enable
hook window WinSetOption filetype=.* readline-disable
}
```
Always use Readline mappings:
``` kak
# ~/.config/kak/kakrc
hook global WinCreate .* readline-enable
```
## To-do
- Implement `reverse-search-history (C-r)` and `forward-search-history
(C-s)`.
- Maybe respect `%opt{extra_word_chars}`?
## Bugs and notes
- `` kills two words backward if the cursor is exactly one
character into the latter, e.g. `one two t|hree four` becomes `one
|hree four` where `|` represents the cursor.
- `transpose-char` and `transpose-word` traverse line breaks.
- If the cursor is in the middle of the word,
`delete-horizontal-space` deletes whitespace after it.
- The `` (`unix-line-discard`) mapping overrides Kakoune’s
default:
commit changes up to now as a single undo group