From anywhere in your terminal (even inside tmux), run:
t <query>
This will:
cd
into the first match for<query>
- if zoxide found a match, tmux will attach to the corrsponding session
If no session exists, it will create a new one and attach to it.
This is a hyper-minimalist and modest version of joshmedeski's t-smart-tmux-session-manager, based on the first version shown on his video.
git clone git@github.com:maxiskell/t.git && sudo mv t/t /usr/local/bin && rm -rf t
Add these settings to your tmux.conf
for a better experience.
# don't exit from tmux when closing a session
set -g detach-on-destroy off
# skip "kill-pane 1? (y/n)" prompt
bind x kill-pane