mirror of
1
0
Fork 0
This commit is contained in:
Gregory Pakosz 2018-03-04 22:42:24 +01:00
parent c4ac0dcc3f
commit 6a67d4e267
1 changed files with 17 additions and 26 deletions

View File

@ -720,35 +720,26 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# EOF # EOF
# #
# tmux_conf_copy_to_os_clipboard=${tmux_conf_copy_to_os_clipboard:-false} # tmux_conf_copy_to_os_clipboard=${tmux_conf_copy_to_os_clipboard:-false}
# command -v pbcopy > /dev/null 2>&1 && command='pbcopy' # # shellcheck disable=SC2086
# command -v reattach-to-user-namespace > /dev/null 2>&1 && command='reattach-to-user-namespace pbcopy' # for table in "" "-t emacs-copy" "-t vi-copy"; do
# command -v xsel > /dev/null 2>&1 && command='xsel -i -b' # line=$(tmux list-keys $table 2>/dev/null | grep -e 'copy-selection\|append-selection' | head -1)
# ! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1 && command='xclip -i -selection clipboard > \/dev\/null 2>\&1' # [ -z "$line" ] && continue
# command -v clip.exe > /dev/null 2>&1 && command='clip\.exe' # prefix=${line%copy-*}
# [ -c /dev/clipboard ] && command='cat > \/dev\/clipboard' # column=${#prefix}
# #
# if [ -n "$command" ]; then # while IFS= read -r line; do
# # shellcheck disable=SC2086
# for table in "" "-t emacs-copy" "-t vi-copy"; do
# line=$(tmux list-keys $table 2>/dev/null | grep -e 'copy-selection\|copy-pipe' | head -1)
# prefix=${line%copy-*}
# column=${#prefix}
# [ -z "$line" ] && continue # [ -z "$line" ] && continue
# # left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g')
# while IFS= read -r line; do # if _is_enabled "$tmux_conf_copy_to_os_clipboard"; then
# [ -z "$line" ] && continue # right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/;/\\\\\\\;/g' -e 's/-selection(-and-cancel)?$/-selection\1 \\\\\\\; run-shell "cut -c3- ~\/\.tmux\.conf | sh -s _copy #{pane_tty}"/g')
# left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g') # else
# if _is_enabled "$tmux_conf_copy_to_os_clipboard"; then # right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/\\"/"/g' -e 's/run-shell "cut -c3- ~\/\.tmux\.conf \| sh -s _copy #\{pane_tty\}"//g' -e 's/#\{.+\}/\"&\"/g')
# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e "s/copy-selection(-and-cancel)?$/copy-pipe\1 \"$command\"/g") # fi
# else # eval "tmux $left $right" 2>/dev/null || true
# right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e "s/copy-pipe(-and-cancel)? \"$command\"$/copy-selection\1/g") # done << EOF
# fi # $(tmux list-keys $table 2>/dev/null | grep -e 'copy-selection\|append-selection')
# eval "tmux $left $right" 2>/dev/null || true
# done << EOF
# $(tmux list-keys $table 2>/dev/null | grep -e 'copy-selection\|copy-pipe')
# EOF # EOF
# done # done
# fi
# } # }
# #
# _apply_theme() { # _apply_theme() {