Skip to content

Commit

Permalink
Make A-hjkl tree-sitter nav A-pion (#2205)
Browse files Browse the repository at this point in the history
A-hl currently is not very consistent with hl when next object is
selected, since it may go up/down or left/right and this behavior is
confusing such that some people think it should swap the keys with A-jk,
so it is better to use A-pn since that only specifies two direction.

A-jk have the same issue as in it usually moves right and is not
consistent with the behavior of jk so people may think A-hl is better,
maybe A-oi is better here since A-hl will be swapped to A-pn, A-oi can
convey the meaning of in and out, similar to some window manager keys?
  • Loading branch information
pickfire authored Apr 29, 2022
1 parent e10cf08 commit ab6a00e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions book/src/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@
| `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`, `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` |
| `Alt-o`, `Alt-up` | Expand selection to parent syntax node (**TS**) | `expand_selection` |
| `Alt-i`, `Alt-down` | Shrink syntax tree object selection (**TS**) | `shrink_selection` |
| `Alt-p`, `Alt-left` | Select previous sibling node in syntax tree (**TS**) | `select_prev_sibling` |
| `Alt-n`, `Alt-right` | Select next sibling node in syntax tree (**TS**) | `select_next_sibling` |

### Search

Expand Down
8 changes: 4 additions & 4 deletions helix-term/src/keymap/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ pub fn default() -> HashMap<Mode, Keymap> {
"S" => split_selection,
";" => collapse_selection,
"A-;" => flip_selections,
"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,
"A-o" | "A-up" => expand_selection,
"A-i" | "A-down" => shrink_selection,
"A-p" | "A-left" => select_prev_sibling,
"A-n" | "A-right" => select_next_sibling,

"%" => select_all,
"x" => extend_line,
Expand Down

0 comments on commit ab6a00e

Please sign in to comment.