aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-09-11 08:27:03 +0800
committerGuangxiong Lin <[email protected]>2022-09-11 08:27:03 +0800
commit8a541c3fbc9639a86d3a8166f2598e68f0e59cd9 (patch)
treec4afa36239eb1073d8893a284c754c3ee4277fac
parent255f08ddddc448bf8a9f3454d696b778999f7c54 (diff)
downloaddotfiles-8a541c3fbc9639a86d3a8166f2598e68f0e59cd9.tar.gz
dotfiles-8a541c3fbc9639a86d3a8166f2598e68f0e59cd9.tar.bz2
dotfiles-8a541c3fbc9639a86d3a8166f2598e68f0e59cd9.zip
More fzf functions
-rwxr-xr-x.fzfrc15
1 files changed, 15 insertions, 0 deletions
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/ .*//")
+}