diff options
author | omentic | 2024-05-01 23:29:52 +0000 |
---|---|---|
committer | omentic | 2024-05-01 23:29:52 +0000 |
commit | 2244a5d40c83d477839f91cb6d6a4aeb02446a97 (patch) | |
tree | 732f056b43a7efbf5b2a75fda060a4cd5b87df66 /remapping.html | |
parent | 313d5f75a7406da11e5b9424857be19866022e3e (diff) |
deploy: 12eec890240a05d1e090114f7f4fdd7c1ee8ff88
Diffstat (limited to 'remapping.html')
-rw-r--r-- | remapping.html | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/remapping.html b/remapping.html index e49afd36..aaacb71d 100644 --- a/remapping.html +++ b/remapping.html @@ -188,59 +188,59 @@ directory (default <code>~/.config/helix</code> on Linux systems) with a structu this:</p> <pre><code class="language-toml"># At most one section each of 'keys.normal', 'keys.insert' and 'keys.select' [keys.normal] -C-s = ":w" # Maps Ctrl-s to the typable command :w which is an alias for :write (save file) -C-o = ":open ~/.config/helix/config.toml" # Maps Ctrl-o to opening of the helix config file -a = "move_char_left" # Maps the 'a' key to the move_char_left command -w = "move_line_up" # Maps the 'w' key move_line_up -"C-S-esc" = "extend_line" # Maps Ctrl-Shift-Escape to extend_line -g = { a = "code_action" } # Maps `ga` to show possible code actions -"ret" = ["open_below", "normal_mode"] # Maps the enter key to open_below then re-enter normal mode +C-s = ":w" # Maps Ctrl-s to the typable command :w which is an alias for :write (save file) +C-o = ":open ~/.config/helix/config.toml" # Maps Ctrl-o to opening of the helix config file +a = "move_char_left" # Maps the 'a' key to the move_char_left command +w = "move_line_up" # Maps the 'w' key move_line_up +"C-S-esc" = "extend_line" # Maps Ctrl-Shift-Escape to extend_line +g = { a = "code_action" } # Maps `ga` to show possible code actions +"ret" = ["open_below", "normal_mode"] # Maps the enter key to open_below then re-enter normal mode [keys.insert] -"A-x" = "normal_mode" # Maps Alt-X to enter normal mode -j = { k = "normal_mode" } # Maps `jk` to exit insert mode +"A-x" = "normal_mode" # Maps Alt-X to enter normal mode +j = { k = "normal_mode" } # Maps `jk` to exit insert mode </code></pre> <h2 id="minor-modes"><a class="header" href="#minor-modes">Minor modes</a></h2> <p>Minor modes are accessed by pressing a key (usually from normal mode), giving access to dedicated bindings. Bindings can be modified or added by nesting definitions.</p> <pre><code class="language-toml">[keys.insert.j] -k = "normal_mode" # Maps `jk` to exit insert mode +k = "normal_mode" # Maps `jk` to exit insert mode [keys.normal.g] -a = "code_action" # Maps `ga` to show possible code actions +a = "code_action" # Maps `ga` to show possible code actions # invert `j` and `k` in view mode [keys.normal.z] -j = "scroll_up" -k = "scroll_down" +j = "scroll_up" +k = "scroll_down" # create a new minor mode bound to `+` -[keys.normal."+"] -m = ":run-shell-command make" -c = ":run-shell-command cargo build" -t = ":run-shell-command cargo test" +[keys.normal."+"] +m = ":run-shell-command make" +c = ":run-shell-command cargo build" +t = ":run-shell-command cargo test" </code></pre> <h2 id="special-keys-and-modifiers"><a class="header" href="#special-keys-and-modifiers">Special keys and modifiers</a></h2> <p>Ctrl, Shift and Alt modifiers are encoded respectively with the prefixes <code>C-</code>, <code>S-</code> and <code>A-</code>. Special keys are encoded as follows:</p> <div class="table-wrapper"><table><thead><tr><th>Key name</th><th>Representation</th></tr></thead><tbody> -<tr><td>Backspace</td><td><code>"backspace"</code></td></tr> -<tr><td>Space</td><td><code>"space"</code></td></tr> -<tr><td>Return/Enter</td><td><code>"ret"</code></td></tr> -<tr><td>-</td><td><code>"minus"</code></td></tr> -<tr><td>Left</td><td><code>"left"</code></td></tr> -<tr><td>Right</td><td><code>"right"</code></td></tr> -<tr><td>Up</td><td><code>"up"</code></td></tr> -<tr><td>Down</td><td><code>"down"</code></td></tr> -<tr><td>Home</td><td><code>"home"</code></td></tr> -<tr><td>End</td><td><code>"end"</code></td></tr> -<tr><td>Page Up</td><td><code>"pageup"</code></td></tr> -<tr><td>Page Down</td><td><code>"pagedown"</code></td></tr> -<tr><td>Tab</td><td><code>"tab"</code></td></tr> -<tr><td>Delete</td><td><code>"del"</code></td></tr> -<tr><td>Insert</td><td><code>"ins"</code></td></tr> -<tr><td>Null</td><td><code>"null"</code></td></tr> -<tr><td>Escape</td><td><code>"esc"</code></td></tr> +<tr><td>Backspace</td><td><code>"backspace"</code></td></tr> +<tr><td>Space</td><td><code>"space"</code></td></tr> +<tr><td>Return/Enter</td><td><code>"ret"</code></td></tr> +<tr><td>-</td><td><code>"minus"</code></td></tr> +<tr><td>Left</td><td><code>"left"</code></td></tr> +<tr><td>Right</td><td><code>"right"</code></td></tr> +<tr><td>Up</td><td><code>"up"</code></td></tr> +<tr><td>Down</td><td><code>"down"</code></td></tr> +<tr><td>Home</td><td><code>"home"</code></td></tr> +<tr><td>End</td><td><code>"end"</code></td></tr> +<tr><td>Page Up</td><td><code>"pageup"</code></td></tr> +<tr><td>Page Down</td><td><code>"pagedown"</code></td></tr> +<tr><td>Tab</td><td><code>"tab"</code></td></tr> +<tr><td>Delete</td><td><code>"del"</code></td></tr> +<tr><td>Insert</td><td><code>"ins"</code></td></tr> +<tr><td>Null</td><td><code>"null"</code></td></tr> +<tr><td>Escape</td><td><code>"esc"</code></td></tr> </tbody></table> </div> <p>Keys can be disabled by binding them to the <code>no_op</code> command.</p> @@ -249,15 +249,15 @@ t = ":run-shell-command cargo test" # Only these normal mode bindings will be used [keys.normal] -n = "normal_mode" -t = "goto_definition" +n = "normal_mode" +t = "goto_definition" # remember to add bindings to return to normal mode [keys.select] -esc = "normal_mode" +esc = "normal_mode" [keys.insert] -esc = "normal_mode" +esc = "normal_mode" </code></pre> <p>A list of commands is available in the <a href="https://docs.helix-editor.com/keymap.html">Keymap</a> documentation and in the source code at <a href="https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs"><code>helix-term/src/commands.rs</code></a> at the invocation of <code>static_commands!</code> macro and the <code>TypableCommandList</code>.</p> |