diff options
Diffstat (limited to '.functions')
-rw-r--r-- | .functions | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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." +} |