From 8a541c3fbc9639a86d3a8166f2598e68f0e59cd9 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Sun, 11 Sep 2022 08:27:03 +0800 Subject: More fzf functions --- .fzfrc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.fzfrc b/.fzfrc index 20b4535..0d3b3fa 100755 --- a/.fzfrc +++ b/.fzfrc @@ -64,3 +64,18 @@ tm() { session=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | fzf --exit-0) && tmux $change -t "$session" || echo "No sessions found." } +if command -v jrnl > /dev/null; then + fjrnl () { + title=$(jrnl --short | fzf --tac --no-sort) && + jrnl -on "$(echo $title | cut -c 1-16)" $1 + } +fi + +# fcs - get git commit sha +# example usage: git rebase -i `fcs` +fcs() { + local commits commit + commits=$(git log --color=always --pretty=oneline --abbrev-commit --reverse) && + commit=$(echo "$commits" | fzf --tac +s +m -e --ansi --reverse) && + echo -n $(echo "$commit" | sed "s/ .*//") +} -- cgit v1.2.3