Quick tmux setup
Keep your tmux config clean with an include file:
lazy-tmux setup >> ~/.tmux.confThis command puts some rules to the end of your tmux config. After reloading tmux config:
- You can call picker with
<prefix> + f - You can save all sessions with 5000 lines of scrollback with
<prefix> + <C-s> - A daemon will run on your system, saving all sessions with 5000 lines of scrollback every 3 minutes.
Feel free to open your config and edit any parameters. For example you can configure picker popup size:
bind-key f display-popup -B -w 65% -h 75% -E 'lazy-tmux picker'Alt-Tab-style session switching
The sessions-only picker reads the compact session index and skips window snapshots and integration status checks. It starts on the current session, wraps at both ends, and is designed for a narrow popup on the left edge. Live sessions stay grouped above sleeping sessions. Within each group, recently used sessions appear first, like an operating system Alt-Tab switcher. Popup bindings require tmux 3.2 or newer:
bind-key -n C-j display-popup -B -x 0 -y 0 -w 32 -h 100% -E 'lazy-tmux picker --sessions-only'
bind-key -n C-k display-popup -B -x 0 -y 0 -w 32 -h 100% -E 'lazy-tmux picker --sessions-only'On tmux 2.9–3.1, open the same picker in a temporary window instead:
bind-key -n C-j new-window -n quick-switch 'lazy-tmux picker --sessions-only'
bind-key -n C-k new-window -n quick-switch 'lazy-tmux picker --sessions-only'Configure your terminal to send Ctrl-J for Cmd-J and Ctrl-K for Cmd-K. The first shortcut opens the popup with the current session selected. While it is open, press the shortcut again to move down or up, then Enter to switch. lazy-tmux cannot bind the macOS Command key directly because tmux receives the key sequence produced by the terminal.
Or edit time interval:
run-shell -b 'lazy-tmux daemon --interval 5m --scrollback > /tmp/lazy-tmux.log 2>&1 || tmux display-message "lazy-tmux daemon already running"'Or up scrollback lines limit:
run-shell -b 'lazy-tmux daemon --interval 3m --scrollback --scrollback-lines 8000 > /tmp/lazy-tmux.log 2>&1 || tmux display-message "lazy-tmux daemon already running"'Or remap saving shortcut:
bind-key C-S run-shell 'lazy-tmux save --all --scrollback && tmux display-message "All sessions saved successfully!"'