From 7e25fed27caf62a7305c8caac0a0171e17a37b97 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Mon, 2 Sep 2024 11:08:14 +0200 Subject: [PATCH] tmux:textobjs: Implement more objects (`,[,(,<,{) --- .config/tmux/textobjs.sh | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.config/tmux/textobjs.sh b/.config/tmux/textobjs.sh index 5640074..a71fc23 100755 --- a/.config/tmux/textobjs.sh +++ b/.config/tmux/textobjs.sh @@ -113,7 +113,7 @@ case "$motion" in tmux send -X end-of-line ;; - # TODO: These two fail when the cursor sits on the quote + # TODO: All following break when the cursor sits on the start or end \") tmux send -X jump-to-backward '"' tmux send -X other-end @@ -124,4 +124,30 @@ case "$motion" in tmux send -X other-end tmux send -X jump-to-forward "'" ;; + \`) + tmux send -X jump-to-backward '`' + tmux send -X other-end + tmux send -X jump-to-forward '`' + ;; + '[|]') + tmux send -X jump-to-backward '[' + tmux send -X other-end + tmux send -X jump-to-forward ']' + ;; + 'b|(|)') + tmux send -X jump-to-backward '(' + tmux send -X other-end + tmux send -X jump-to-forward ')' + ;; + '<|>') + tmux send -X jump-to-backward '<' + tmux send -X other-end + tmux send -X jump-to-forward '>' + ;; + 'B|{|}') + # TODO: make this work over multiple lines + tmux send -X jump-to-backward '{' + tmux send -X other-end + tmux send -X jump-to-forward '}' + ;; esac