Skip to content

Instantly share code, notes, and snippets.

@vitorbertulucci
Created December 22, 2021 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitorbertulucci/f627538a9c44d7950ec55b9ae84e456a to your computer and use it in GitHub Desktop.
Save vitorbertulucci/f627538a9c44d7950ec55b9ae84e456a to your computer and use it in GitHub Desktop.
Fuzifinder tmux helper
#!/usr/bin/env bash
# I took this code from https://github.com/awesome-streamers/awesome-streamerrc/blob/master/ThePrimeagen/tmux2
# And updated it to my use-case
if [[ $# -eq 1 ]]; then
selected=$1
else
items=`find ~/Projects -maxdepth 1 -mindepth 1 -type d`
selected=`echo "$items" | fzf`
fi
dirname=`basename $selected`
tmux switch-client -t $dirname
if [[ $? -eq 0 ]]; then
exit 0
fi
tmux new-session -c $selected -d -s $dirname && tmux switch-client -t $dirname || tmux new -c $selected -A -s $dirname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment