on master help sign in
Change default TS object bindings (#3782)
7210c58nosa
book/src/keymap.md+7−7
@@ -297,7 +297,7 @@ Displays documentation for item under cursor.
297| ---- | ----------- |
297| ---- | ----------- |
298| `Ctrl-u` | Scroll up |
298| `Ctrl-u` | Scroll up |
299| `Ctrl-d` | Scroll down |
299| `Ctrl-d` | Scroll down |
300−
300+
301#### Unimpaired
301#### Unimpaired
302
302
303Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaired).
303Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaired).
@@ -310,14 +310,14 @@ Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaire
310| `]D` | Go to last diagnostic in document (**LSP**) | `goto_last_diag` |
310| `]D` | Go to last diagnostic in document (**LSP**) | `goto_last_diag` |
311| `]f` | Go to next function (**TS**) | `goto_next_function` |
311| `]f` | Go to next function (**TS**) | `goto_next_function` |
312| `[f` | Go to previous function (**TS**) | `goto_prev_function` |
312| `[f` | Go to previous function (**TS**) | `goto_prev_function` |
313−| `]c` | Go to next class (**TS**) | `goto_next_class` |
313+| `]t` | Go to next type definition (**TS**) | `goto_next_class` |
314−| `[c` | Go to previous class (**TS**) | `goto_prev_class` |
314+| `[t` | Go to previous type definition (**TS**) | `goto_prev_class` |
315| `]a` | Go to next argument/parameter (**TS**) | `goto_next_parameter` |
315| `]a` | Go to next argument/parameter (**TS**) | `goto_next_parameter` |
316| `[a` | Go to previous argument/parameter (**TS**) | `goto_prev_parameter` |
316| `[a` | Go to previous argument/parameter (**TS**) | `goto_prev_parameter` |
317−| `]o` | Go to next comment (**TS**) | `goto_next_comment` |
317+| `]c` | Go to next comment (**TS**) | `goto_next_comment` |
318−| `[o` | Go to previous comment (**TS**) | `goto_prev_comment` |
318+| `[c` | Go to previous comment (**TS**) | `goto_prev_comment` |
319−| `]t` | Go to next test (**TS**) | `goto_next_test` |
319+| `]T` | Go to next test (**TS**) | `goto_next_test` |
320−| `]t` | Go to previous test (**TS**) | `goto_prev_test` |
320+| `]T` | Go to previous test (**TS**) | `goto_prev_test` |
321| `]p` | Go to next paragraph | `goto_next_paragraph` |
321| `]p` | Go to next paragraph | `goto_next_paragraph` |
322| `[p` | Go to previous paragraph | `goto_prev_paragraph` |
322| `[p` | Go to previous paragraph | `goto_prev_paragraph` |
323| `[Space` | Add newline above | `add_newline_above` |
323| `[Space` | Add newline above | `add_newline_above` |
helix-term/src/commands.rs+8−8
@@ -402,8 +402,8 @@ impl MappableCommand {
402 select_textobject_inner, "Select inside object",
402 select_textobject_inner, "Select inside object",
403 goto_next_function, "Goto next function",
403 goto_next_function, "Goto next function",
404 goto_prev_function, "Goto previous function",
404 goto_prev_function, "Goto previous function",
405− goto_next_class, "Goto next class",
405+ goto_next_class, "Goto next type definition",
406− goto_prev_class, "Goto previous class",
406+ goto_prev_class, "Goto previous type definition",
407 goto_next_parameter, "Goto next parameter",
407 goto_next_parameter, "Goto next parameter",
408 goto_prev_parameter, "Goto previous parameter",
408 goto_prev_parameter, "Goto previous parameter",
409 goto_next_comment, "Goto next comment",
409 goto_next_comment, "Goto next comment",
@@ -4520,11 +4520,11 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) {
4520 match ch {
4520 match ch {
4521 'w' => textobject::textobject_word(text, range, objtype, count, false),
4521 'w' => textobject::textobject_word(text, range, objtype, count, false),
4522 'W' => textobject::textobject_word(text, range, objtype, count, true),
4522 'W' => textobject::textobject_word(text, range, objtype, count, true),
4523− 'c' => textobject_treesitter("class", range),
4523+ 't' => textobject_treesitter("class", range),
4524 'f' => textobject_treesitter("function", range),
4524 'f' => textobject_treesitter("function", range),
4525 'a' => textobject_treesitter("parameter", range),
4525 'a' => textobject_treesitter("parameter", range),
4526− 'o' => textobject_treesitter("comment", range),
4526+ 'c' => textobject_treesitter("comment", range),
4527− 't' => textobject_treesitter("test", range),
4527+ 'T' => textobject_treesitter("test", range),
4528 'p' => textobject::textobject_paragraph(text, range, objtype, count),
4528 'p' => textobject::textobject_paragraph(text, range, objtype, count),
4529 'm' => textobject::textobject_pair_surround_closest(
4529 'm' => textobject::textobject_pair_surround_closest(
4530 text, range, objtype, count,
4530 text, range, objtype, count,
@@ -4552,11 +4552,11 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) {
4552 ("w", "Word"),
4552 ("w", "Word"),
4553 ("W", "WORD"),
4553 ("W", "WORD"),
4554 ("p", "Paragraph"),
4554 ("p", "Paragraph"),
4555− ("c", "Class (tree-sitter)"),
4555+ ("t", "Type definition (tree-sitter)"),
4556 ("f", "Function (tree-sitter)"),
4556 ("f", "Function (tree-sitter)"),
4557 ("a", "Argument/parameter (tree-sitter)"),
4557 ("a", "Argument/parameter (tree-sitter)"),
4558− ("o", "Comment (tree-sitter)"),
4558+ ("c", "Comment (tree-sitter)"),
4559− ("t", "Test (tree-sitter)"),
4559+ ("T", "Test (tree-sitter)"),
4560 ("m", "Closest surrounding pair to cursor"),
4560 ("m", "Closest surrounding pair to cursor"),
4561 (" ", "... or any character acting as a pair"),
4561 (" ", "... or any character acting as a pair"),
4562 ];
4562 ];
helix-term/src/keymap/default.rs+6−6
@@ -101,10 +101,10 @@ pub fn default() -> HashMap<Mode, Keymap> {
101 "d" => goto_prev_diag,
101 "d" => goto_prev_diag,
102 "D" => goto_first_diag,
102 "D" => goto_first_diag,
103 "f" => goto_prev_function,
103 "f" => goto_prev_function,
104− "c" => goto_prev_class,
104+ "t" => goto_prev_class,
105 "a" => goto_prev_parameter,
105 "a" => goto_prev_parameter,
106− "o" => goto_prev_comment,
106+ "c" => goto_prev_comment,
107− "t" => goto_prev_test,
107+ "T" => goto_prev_test,
108 "p" => goto_prev_paragraph,
108 "p" => goto_prev_paragraph,
109 "space" => add_newline_above,
109 "space" => add_newline_above,
110 },
110 },
@@ -112,10 +112,10 @@ pub fn default() -> HashMap<Mode, Keymap> {
112 "d" => goto_next_diag,
112 "d" => goto_next_diag,
113 "D" => goto_last_diag,
113 "D" => goto_last_diag,
114 "f" => goto_next_function,
114 "f" => goto_next_function,
115− "c" => goto_next_class,
115+ "t" => goto_next_class,
116 "a" => goto_next_parameter,
116 "a" => goto_next_parameter,
117− "o" => goto_next_comment,
117+ "c" => goto_next_comment,
118− "t" => goto_next_test,
118+ "T" => goto_next_test,
119 "p" => goto_next_paragraph,
119 "p" => goto_next_paragraph,
120 "space" => add_newline_below,
120 "space" => add_newline_below,
121 },
121 },