Skip to content

Commit 7cbde7b

Browse files
author
Bruno Sutic
committed
Line copy feature now works accross multiple lines
1 parent 22c55ea commit 7cbde7b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/copy_line.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,19 @@ start_tmux_selection() {
3030
fi
3131
}
3232

33+
# works when command spans accross multiple lines
3334
end_of_line_in_copy_mode() {
3435
if [ "$TMUX_COPY_MODE" == "vi" ]; then
3536
# vi copy mode
36-
tmux send-key '$'
37+
# This sequence of keys consistently selects multiple lines
38+
tmux send-key 'G' # go the the bottom of scrollback buffer
39+
tmux send-key 'b' # beginning previous word
40+
tmux send-key 'e' # end of next word
3741
else
3842
# emacs copy mode
3943
tmux send-key 'C-e'
44+
tmux send-key 'M-b'
45+
tmux send-key 'M-f'
4046
fi
4147
}
4248

0 commit comments

Comments
 (0)