Add arrow key mappings for tree-sitter parent/child/sibling nav (#1724)

* Add arrow key mappings for tree-sitter parent/child/sibling nav

This helps my use case, where I use a non-qwerty layout with a
programmable mechanical keyboard, and use a layer switching key (think
fn) to send left down up right from the traditional hjkl positions.

* Add new bindings to docs
This commit is contained in:
Daniel S Poulin 2022-03-08 00:02:03 -05:00 committed by GitHub
parent bde0307c87
commit 24352b2729
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 32 deletions

View File

@ -119,10 +119,10 @@ ### Selection manipulation
| `K` | Keep selections matching the regex | `keep_selections` |
| `Alt-K` | Remove selections matching the regex | `remove_selections` |
| `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` |
| `Alt-k` | Expand selection to parent syntax node (**TS**) | `expand_selection` |
| `Alt-j` | Shrink syntax tree object selection (**TS**) | `shrink_selection` |
| `Alt-h` | Select previous sibling node in syntax tree (**TS**) | `select_prev_sibling` |
| `Alt-l` | Select next sibling node in syntax tree (**TS**) | `select_next_sibling` |
| `Alt-k`/`Alt-up` | Expand selection to parent syntax node (**TS**) | `expand_selection` |
| `Alt-j`/`Alt-down` | Shrink syntax tree object selection (**TS**) | `shrink_selection` |
| `Alt-h`/`Alt-left` | Select previous sibling node in syntax tree (**TS**) | `select_prev_sibling` |
| `Alt-l`/`Alt-right` | Select next sibling node in syntax tree (**TS**) | `select_next_sibling` |
### Search

View File

@ -584,10 +584,10 @@ fn default() -> Self {
"S" => split_selection,
";" => collapse_selection,
"A-;" => flip_selections,
"A-k" => expand_selection,
"A-j" => shrink_selection,
"A-h" => select_prev_sibling,
"A-l" => select_next_sibling,
"A-k" | "A-up" => expand_selection,
"A-j" | "A-down" => shrink_selection,
"A-h" | "A-left" => select_prev_sibling,
"A-l" | "A-right" => select_next_sibling,
"%" => select_all,
"x" => extend_line,