aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.functions20
1 files changed, 20 insertions, 0 deletions
diff --git a/.functions b/.functions
index 07f9afe..b34c848 100644
--- a/.functions
+++ b/.functions
@@ -14,3 +14,23 @@ fco () {
) || return
git checkout $(awk '{print $2}' <<<$target)
}
+
+fjrnl () {
+ title=$(jrnl --short | fzf --tac --no-sort) \
+ && jrnl -on $(echo $title | cut -c 1-16) $1
+}
+
+fs () {
+ local session
+ session=$(tmux list-sessions -F "#{session_name}" \
+ | fzf --query=$1 --select-1 --exit-0) \
+ && tmux switch-client -t $session
+}
+
+tm() {
+ [[ -n "$TMUX" ]] && change="switch-client" || change="attach-session"
+ if [ $1 ]; then
+ tmux $change -t "$1" 2>/dev/null || (tmux new-session -d -s $1 && tmux $change -t "$1"); return
+ fi
+ session=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | fzf --exit-0) && tmux $change -t "$session" || echo "No sessions found."
+}