rename tmux-is-at-least with _

This commit is contained in:
Christian Höltje 2017-05-05 22:34:40 -04:00
parent e012849621
commit 0db3e88f33
3 changed files with 7 additions and 7 deletions

View file

@ -37,7 +37,7 @@
}
start_tmux_selection() {
if tmux-is-at-least 2.4; then
if tmux_is_at_least 2.4; then
echo "$TMUX_COPY_MODE" >> /tmp/tmux
tmux send -X begin-selection
elif [ "$TMUX_COPY_MODE" == "vi" ]; then
@ -51,7 +51,7 @@
# works when command spans accross multiple lines
end_of_line_in_copy_mode() {
if tmux-is-at-least 2.4; then
if tmux_is_at_least 2.4; then
tmux send -X -N 150 'cursor-down' # 'down' key. 'vi' mode is faster so we're
# jumping more lines than emacs.
tmux send -X 'end-of-line' # End of line (just in case we are already at the last line).
@ -78,7 +78,7 @@
}
yank_to_clipboard() {
if tmux-is-at-least 2.4; then
if tmux_is_at_least 2.4; then
tmux send -X copy-pipe-and-cancel "$(clipboard_copy_command)"
else
tmux send-key "$(yank_wo_newline_key)"
@ -94,7 +94,7 @@
}
yank_current_line() {
if tmux-is-at-least 2.4; then
if tmux_is_at_least 2.4; then
enter_tmux_copy_mode
tmux send -X select-line
yank_to_clipboard

View file

@ -132,7 +132,7 @@
}
tmux_version="$(tmux -V | cut -d ' ' -f 2)"
tmux-is-at-least() {
tmux_is_at_least() {
if [[ $tmux_version == "$1" ]]
then
return 0

View file

@ -16,7 +16,7 @@
local key_bindings key
key_bindings="$(yank_key) $(put_key) $(yank_put_key)"
for key in $key_bindings; do
if tmux-is-at-least 2.4; then
if tmux_is_at_least 2.4; then
tmux bind-key -t copy-mode-vi "$key" send-keys -X copy-pipe-and-cancel "tmux display-message 'Error! tmux-yank dependencies not installed!'"
tmux bind-key -t copy-mode "$key" send-keys -X copy-pipe-and-cancel "tmux display-message 'Error! tmux-yank dependencies not installed!'"
else
@ -40,7 +40,7 @@
local copy_command="$1"
local copy_wo_newline_command
copy_wo_newline_command="$(clipboard_copy_without_newline_command "$copy_command")"
if tmux-is-at-least 2.4; then
if tmux_is_at_least 2.4; then
tmux bind-key -T copy-mode-vi "$(yank_key)" send-keys -X copy-pipe-and-cancel "$copy_command"
tmux bind-key -T copy-mode-vi "$(put_key)" send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
tmux bind-key -T copy-mode-vi "$(yank_put_key)" send-keys -X copy-pipe-and-cancel "$copy_command; tmux paste-buffer"