Skip to content

Instantly share code, notes, and snippets.

@byStrange
Created May 4, 2026 11:58
Show Gist options
  • Select an option

  • Save byStrange/3cee0450453a211478a971f4415e4c53 to your computer and use it in GitHub Desktop.

Select an option

Save byStrange/3cee0450453a211478a971f4415e4c53 to your computer and use it in GitHub Desktop.
# Defined in /home/ron/.config/fish/functions/gtm.fish @ line 1 function gtm set -l target (locate -r '/\.git$' | rev | cut -d/ -f2- | rev | fzf) if test -n "$target" set -l name (string replace -r '\.' '_' (basename "$target")) if not tmux has-session -t "$name" 2>/dev/null tmux new-session -d -c "$target" -s "$name" end if test -n "$TMUX" tmux switch-client -t "$name" else tmux attach-session -t "$name" end end end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment