Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix typo (send-key) #184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions scripts/copy_line.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ add_sleep_for_remote_shells() {

go_to_the_beginning_of_current_line() {
if [ "$(shell_mode)" == "emacs" ]; then
tmux send-key 'C-a'
tmux send-keys 'C-a'
else
tmux send-key 'Escape' '0'
tmux send-keys 'Escape' '0'
fi
}

Expand All @@ -41,10 +41,10 @@ start_tmux_selection() {
tmux send -X begin-selection
elif [ "$TMUX_COPY_MODE" == "vi" ]; then
# vi copy mode
tmux send-key 'Space'
tmux send-keys 'Space'
else
# emacs copy mode
tmux send-key 'C-Space'
tmux send-keys 'C-Space'
fi
}

Expand All @@ -59,20 +59,20 @@ end_of_line_in_copy_mode() {
elif [ "$TMUX_COPY_MODE" == "vi" ]; then
# vi copy mode
# This sequence of keys consistently selects multiple lines
tmux send-key '150' # Go to the bottom of scrollback buffer by using
tmux send-key 'j' # 'down' key. 'vi' mode is faster so we're
tmux send-keys '150' # Go to the bottom of scrollback buffer by using
tmux send-keys 'j' # 'down' key. 'vi' mode is faster so we're
# jumping more lines than emacs.
tmux send-key '$' # End of line (just in case we are already at the last line).
tmux send-key 'b' # Beginning of the previous word.
tmux send-key 'e' # End of next word.
tmux send-keys '$' # End of line (just in case we are already at the last line).
tmux send-keys 'b' # Beginning of the previous word.
tmux send-keys 'e' # End of next word.
else
# emacs copy mode
for ((c = 1; c <= '30'; c++)); do # go to the bottom of scrollback buffer
tmux send-key 'C-n'
done
tmux send-key 'C-e'
tmux send-key 'M-b'
tmux send-key 'M-f'
tmux send-keys 'C-e'
tmux send-keys 'M-b'
tmux send-keys 'M-f'
fi
}

Expand All @@ -81,7 +81,7 @@ yank_to_clipboard() {
# shellcheck disable=SC2119
tmux send -X copy-pipe-and-cancel "$(clipboard_copy_command)"
else
tmux send-key "$(yank_wo_newline_key)"
tmux send-keys "$(yank_wo_newline_key)"
fi
}

Expand Down