From 8af0b5c79ab530955054825303a36401c619c83e Mon Sep 17 00:00:00 2001 From: druckdev Date: Sun, 16 May 2021 00:09:53 +0200 Subject: [PATCH] zsh:autoload:glog,gstash: Get rid of redundancy --- .config/zsh/autoload/glog | 18 +++++++++--------- .config/zsh/autoload/gstash | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.config/zsh/autoload/glog b/.config/zsh/autoload/glog index 4663f2d..6dd3eb3 100755 --- a/.config/zsh/autoload/glog +++ b/.config/zsh/autoload/glog @@ -45,15 +45,6 @@ local commit_hash='s/^[^a-f0-9]*([a-f0-9]*).*$/\1/' local dateshort='--date=format:%F' # year local date="$dateshort %T %z" # year time timezone -# Put the commit hash into the clipboard -# (If no known clipboard tool is available, just print it) -local fzf_copy_command="echo -nE {} | sed -E '$commit_hash'" -if [[ $OSTYPE =~ darwin ]] && command -v pbcopy &>/dev/null; then - fzf_copy_command+=" | pbcopy" -elif command -v xclip &>/dev/null; then - fzf_copy_command+=" | xclip -selection c" -fi - local -A fzf_preview read -r -d '' </dev/null; then + fzf_copy_command+=" | pbcopy" +elif command -v xclip &>/dev/null; then + fzf_copy_command+=" | xclip -selection c" +fi + local -A binds=( "ctrl-space" "toggle-preview" "ctrl-alt-j" "preview-down" diff --git a/.config/zsh/autoload/gstash b/.config/zsh/autoload/gstash index 0c2248e..e77d2b2 100755 --- a/.config/zsh/autoload/gstash +++ b/.config/zsh/autoload/gstash @@ -45,15 +45,6 @@ local commit_hash='s/^[^a-f0-9]*([a-f0-9]*).*$/\1/' local dateshort='--date=format:%F' # year local date="$dateshort %T %z" # year time timezone -# Put the commit hash into the clipboard -# (If no known clipboard tool is available, just print it) -local fzf_copy_command="echo -nE {} | sed -E '$commit_hash'" -if [[ $OSTYPE =~ darwin ]] && command -v pbcopy &>/dev/null; then - fzf_copy_command+=" | pbcopy" -elif command -v xclip &>/dev/null; then - fzf_copy_command+=" | xclip -selection c" -fi - local -A fzf_preview read -r -d '' </dev/null; then + fzf_copy_command+=" | pbcopy" +elif command -v xclip &>/dev/null; then + fzf_copy_command+=" | xclip -selection c" +fi + local -A binds=( "ctrl-space" "toggle-preview" "ctrl-alt-j" "preview-down"