From d8f432655e76dc3490185aa20d121f4e59895c20 Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Sat, 10 Oct 2020 13:12:19 +0200 Subject: [PATCH] zsh:glog: Push to editor buffer rather clipboard This removes the dependency of xclip and makes it more usable since when I need the commit hash it will almost always be in the next command. --- .config/zsh/autoload/glog | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.config/zsh/autoload/glog b/.config/zsh/autoload/glog index d55e592..0da1503 100755 --- a/.config/zsh/autoload/glog +++ b/.config/zsh/autoload/glog @@ -72,12 +72,10 @@ commit="$(\ git log "$formatshort" --graph "$dateshort" "$colors" \ | fzf "${fzf_args[@]}" )" -# If fzf exits successfully, put the abbreviated commit hash into the clipboard -# and write it onto stdout. +# If fzf exits successfully, push the abbreviated commit hash onto the editing +# buffer stack and write it to stdout. if ! (( $? )); then commit="$(sed -Ee "$del_ansi" -e "$commit_hash" <<<"$commit")" - if command -v xclip &>/dev/null; then - echo -n "$commit" | xclip -selection clip - fi + pushln "$commit" echo "$commit" fi