mirror of
https://github.com/tmux-plugins/tmux-yank.git
synced 2026-09-10 07:36:17 -04:00
Added shell vi mode compatibility
This commit is contained in:
parent
93749131a8
commit
4d521c1363
|
|
@ -22,7 +22,13 @@
|
|||
}
|
||||
|
||||
go_to_the_beginning_of_current_line() {
|
||||
tmux send-key 'C-a'
|
||||
if [ "$(shell_mode)" == "emacs" ]; then
|
||||
tmux send-key 'C-a'
|
||||
else
|
||||
tmux send-key 'Escape'
|
||||
tmux send-key '0'
|
||||
tmux send-key 'i'
|
||||
fi
|
||||
add_sleep_for_remote_shells
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +73,13 @@
|
|||
}
|
||||
|
||||
go_to_the_end_of_current_line() {
|
||||
tmux send-keys 'C-e'
|
||||
if [ "$(shell_mode)" == "emacs" ]; then
|
||||
tmux send-keys 'C-e'
|
||||
else
|
||||
tmux send-keys 'Escape'
|
||||
tmux send-keys '$'
|
||||
tmux send-keys 'i'
|
||||
fi
|
||||
}
|
||||
|
||||
display_notice() {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@
|
|||
yank_selection_default="clipboard"
|
||||
yank_selection_option="@yank_selection"
|
||||
|
||||
shell_mode_default="emacs"
|
||||
shell_mode_option="@shell_mode"
|
||||
|
||||
# helper functions
|
||||
get_tmux_option() {
|
||||
local option="$1"
|
||||
|
|
@ -52,6 +55,9 @@
|
|||
echo "$(get_tmux_option "$yank_selection_option" "$yank_selection_default")"
|
||||
}
|
||||
|
||||
shell_mode() {
|
||||
echo "$(get_tmux_option "$shell_mode_option" "$shell_mode_default")"
|
||||
}
|
||||
# Ensures a message is displayed for 5 seconds in tmux prompt.
|
||||
# Does not override the 'display-time' tmux option.
|
||||
display_message() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue