From 19dd037e7fa5a1f45075be01ebe18a35e62e0e93 Mon Sep 17 00:00:00 2001 From: Lauri Gates Date: Wed, 24 Jun 2026 10:22:36 +0300 Subject: [PATCH] feat(keybinds): bind Home/End and Alt+Backspace in the editor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds default editor keybindings requested upstream: - Home / End → move to line start / end (alongside Ctrl+A / Ctrl+E) (#61) - Alt+Backspace → erase to previous word boundary (alongside Ctrl+W) (#71) These map to existing editor actions (move_to_head, move_to_tail, erase_to_previous_nearest); only the default keybind sets and the README keymap change. termcfg parses the Home/End/Alt+Backspace notation natively. Closes #61 Closes #71 Co-Authored-By: Claude Opus 4.8 (1M context) --- README.md | 12 ++++++------ default.toml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e1edbf1..a289dfe 100644 --- a/README.md +++ b/README.md @@ -137,13 +137,13 @@ cat data.json | jnv -- --write-to-stdout > result.json | Tab | Enter suggestion | | | Move cursor left | | | Move cursor right | -| Ctrl + A | Move cursor to line start | -| Ctrl + E | Move cursor to line end | +| Ctrl + A, Home | Move cursor to line start | +| Ctrl + E, End | Move cursor to line end | | Backspace | Delete character before cursor | | Ctrl + U | Clear entire line | | Alt + B | Move the cursor to the previous nearest character within set(`.`,`\|`,`(`,`)`,`[`,`]`) | | Alt + F | Move the cursor to the next nearest character within set(`.`,`\|`,`(`,`)`,`[`,`]`) | -| Ctrl + W | Erase to the previous nearest character within set(`.`,`\|`,`(`,`)`,`[`,`]`) | +| Ctrl + W, Alt + Backspace | Erase to the previous nearest character within set(`.`,`\|`,`(`,`)`,`[`,`]`) | | Alt + D | Erase to the next nearest character within set(`.`,`\|`,`(`,`)`,`[`,`]`) | #### Suggestion in Editor (after Tab) @@ -369,9 +369,9 @@ backward = ["Left"] forward = ["Right"] # Move cursor to beginning of line -move_to_head = ["Ctrl+A"] +move_to_head = ["Ctrl+A", "Home"] # Move cursor to end of line -move_to_tail = ["Ctrl+E"] +move_to_tail = ["Ctrl+E", "End"] # Move cursor to previous word boundary move_to_previous_nearest = ["Alt+B"] # Move cursor to next word boundary @@ -383,7 +383,7 @@ erase = ["Backspace"] erase_all = ["Ctrl+U"] # Delete from cursor to previous word boundary -erase_to_previous_nearest = ["Ctrl+W"] +erase_to_previous_nearest = ["Ctrl+W", "Alt+Backspace"] # Delete from cursor to next word boundary erase_to_next_nearest = ["Alt+D"] # Trigger completion diff --git a/default.toml b/default.toml index 05f892e..84e93ff 100644 --- a/default.toml +++ b/default.toml @@ -136,9 +136,9 @@ backward = ["Left"] forward = ["Right"] # Move cursor to beginning of line -move_to_head = ["Ctrl+A"] +move_to_head = ["Ctrl+A", "Home"] # Move cursor to end of line -move_to_tail = ["Ctrl+E"] +move_to_tail = ["Ctrl+E", "End"] # Move cursor to previous word boundary move_to_previous_nearest = ["Alt+B"] # Move cursor to next word boundary @@ -150,7 +150,7 @@ erase = ["Backspace"] erase_all = ["Ctrl+U"] # Delete from cursor to previous word boundary -erase_to_previous_nearest = ["Ctrl+W"] +erase_to_previous_nearest = ["Ctrl+W", "Alt+Backspace"] # Delete from cursor to next word boundary erase_to_next_nearest = ["Alt+D"] # Trigger completion