diff options
author | Michael Davis | 2022-01-20 15:52:33 +0000 |
---|---|---|
committer | GitHub | 2022-01-20 15:52:33 +0000 |
commit | 392dfa0841fb106300eedf26f8628e48a32d0ea4 (patch) | |
tree | 8302472ac3791a0e132d18ca72e883738721f8e6 /book | |
parent | fd7080498e2580d1e59580db8fd007fb081257fd (diff) |
add select_next_sibling and select_prev_sibling commands (#1495)
* add select_next_sibling and select_prev_sibling commands
* refactor objects to use higher order functions
* address clippy feedback
* move selection cloning into commands
* add default keybindings under left/right brackets
* use [+t,]+t for selecting sibling syntax nodes
* setup Alt-{j,k,h,l} default keymaps for syntax selection commands
* reduce boilerplate of select_next/prev_sibling in commands
* import tree-sitter Node type in commands
Diffstat (limited to 'book')
-rw-r--r-- | book/src/keymap.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/book/src/keymap.md b/book/src/keymap.md index ea890575..905ec48f 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -119,6 +119,10 @@ | `Alt-K` | Remove selections matching the regex | `remove_selections` | | `$` | Pipe each selection into shell command, keep selections where command returned 0 | `shell_keep_pipe` | | `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` | +| `Alt-k` | Expand selection to parent syntax node | `expand_selection` | +| `Alt-j` | Shrink syntax tree object selection | `shrink_selection` | +| `Alt-h` | Select previous sibling node in syntax tree | `select_prev_sibling` | +| `Alt-l` | Select next sibling node in syntax tree | `select_next_sibling` | ### Search @@ -262,8 +266,6 @@ Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaire | `]D` | Go to last diagnostic in document (**LSP**) | `goto_last_diag` | | `[space` | Add newline above | `add_newline_above` | | `]space` | Add newline below | `add_newline_below` | -| `]o` | Expand syntax tree object selection. | `expand_selection` | -| `[o` | Shrink syntax tree object selection. | `shrink_selection` | ## Insert Mode |