extend-sibling.hx
Extend the selection by one tree-sitter sibling node
Extend the selection by one tree-sitter sibling node
Extend the selection by one tree-sitter sibling node, for Helix.
Helix’s builtin select_next_sibling / select_prev_sibling replace the whole
selection with the neighbouring node. These commands extend it instead, so you
can accrete nodes:
:extend_next_sibling – move the head to the end of the next sibling.:extend_prev_sibling – move the head to the start of the previous sibling.The anchor stays put and only the head moves, as it does for the builtin
extend_parent_node_start / extend_parent_node_end. So a forward selection
accretes with :extend_next_sibling and shrinks with :extend_prev_sibling;
flip it with Alt-; to accrete leftwards instead.
When the current node has no sibling at its level, navigation climbs to the parent, matching the builtin motions. Every range in the selection is moved.
Install with Forge:
forge pkg install --git https://github.com/waddie/extend-sibling.hx
Then in ~/.config/helix/init.scm:
(require "extend-sibling.hx/extend-sibling.scm")
Optionally bind keys, for example:
(keymap (global)
(normal
(A-N ":extend_next_sibling")
(A-P ":extend_prev_sibling"))
(select
(A-n ":extend_next_sibling")
(A-p ":extend_prev_sibling")))
Copyright © 2026 Tom Waddington
Distributed under the MIT License. See LICENSE file for details.