https://github.com/edr3x/tmux-sessionizer
instructions on using tmux-sessionizer to make project workflow blazingly fast
https://github.com/edr3x/tmux-sessionizer
fzf fzf-scripts tmux tmux-scripts
Last synced: 3 months ago
JSON representation
instructions on using tmux-sessionizer to make project workflow blazingly fast
- Host: GitHub
- URL: https://github.com/edr3x/tmux-sessionizer
- Owner: edr3x
- Created: 2022-09-22T16:18:48.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-07T14:02:51.000Z (3 months ago)
- Last Synced: 2025-03-07T15:22:05.495Z (3 months ago)
- Topics: fzf, fzf-scripts, tmux, tmux-scripts
- Homepage:
- Size: 4.88 KB
- Stars: 73
- Watchers: 2
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tmux-sessionizer
tmux-sessionizer is a tmux script that makes your workflow BLAZINGLY FAST written by [ThePrimeagen](https://github.com/ThePrimeagen/)
## Installation
### tmux-sessionizer script
- Save the script on `~/.local/scripts/tmux-sessionizer` where `tmux-sessionizer` is the name of the script
```bash
#!/usr/bin/env bashif [[ $# -eq 1 ]]; then
selected=$1
else
selected=$(find ~/projects ~/tests -mindepth 1 -maxdepth 1 -type d | fzf)
fiif [[ -z $selected ]]; then
exit 0
fiselected_name=$(basename "$selected" | tr . _)
tmux_running=$(pgrep tmux)if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
tmux new-session -s $selected_name -c $selected
exit 0
fiif ! tmux has-session -t=$selected_name 2> /dev/null; then
tmux new-session -ds $selected_name -c $selected
fiif [[ -z $TMUX ]]; then
tmux attach -t $selected_name
else
tmux switch-client -t $selected_name
fi
```- Here change the find paths on line no. 6 to your corresponding paths to projects folder on which you want to work on
## Add the script folder to your path and add the `ctrl+f` macro as a key binding
### For Bash put this in `.bashrc`
```bash
PATH="$PATH":"$HOME/.local/scripts/"
bind '"\C-f":"tmux-sessionizer\n"'
```### For Z shell put this in `.zshrc`
```bash
bindkey -s ^f "tmux-sessionizer\n"
```### For Fish put this in `config.fish`
```sh
set PATH "$PATH":"$HOME/.local/scripts/"
bind \cf "tmux-sessionizer"
```## Add the following script on your `.tmux.conf`
```bash
bind-key -r f run-shell "tmux neww ~/.local/scripts/tmux-sessionizer"
```- This will open fuzzy finder then you can search for the project you want and start new tmux session on that project directory on pressing `f`
### For macro jump i.e. jump directly to your desired project without opening fzf
```bash
bind-key -r k run-shell "~/.local/scripts/tmux-sessionizer ~/projects/work/tmux-theme"
```- This will create a new tmux session on `tmux-theme` project directory when you press `k`
## Finally run following command on your terminal to give permission for `tmux-sessionizer` script to run
```bash
chmod +x ~/.local/scripts/tmux-sessionizer
```## Now restart your shell and enjoy the blazing fast workflow
### Steps to use
- Press `ctrl+f` to open the fzf finder
- type the name of project you want to work on and press enter
- Now you will be on the project directory on tmux session> Note:
>
> you can see prime's [video](https://youtu.be/hJzqEAf2U4I) on this to understand in detail