diff options
author | Guangxiong Lin <[email protected]> | 2022-09-11 08:27:03 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-09-11 08:27:03 +0800 |
commit | 8a541c3fbc9639a86d3a8166f2598e68f0e59cd9 (patch) | |
tree | c4afa36239eb1073d8893a284c754c3ee4277fac | |
parent | 255f08ddddc448bf8a9f3454d696b778999f7c54 (diff) | |
download | dotfiles-8a541c3fbc9639a86d3a8166f2598e68f0e59cd9.tar.gz dotfiles-8a541c3fbc9639a86d3a8166f2598e68f0e59cd9.tar.bz2 dotfiles-8a541c3fbc9639a86d3a8166f2598e68f0e59cd9.zip |
More fzf functions
-rwxr-xr-x | .fzfrc | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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/ .*//") +} |