From 392dfa0841fb106300eedf26f8628e48a32d0ea4 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 20 Jan 2022 09:52:33 -0600 Subject: 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--- book/src/keymap.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'book/src') 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 -- cgit v1.2.3-70-g09d2