Posted by speckx 7 hours ago
set -g status-style "bg=red"
I also like to have the bar on top and the status centered: set -g status-justify absolute-centre
set -g status-position top(I only run it in my own machines so it never runs as root anyway)
set -g mouse on
for multi-monitor setups setw -g aggressive-resize on
is also really nice.Wish they could make this default, not sure why they haven't.
a lot of servers use tmux which probably has some weird broken edge cases
— session configuration save/recall (with pane layout for each tab and directory for each pane[0]),
— nvim integration (for seamless split navigation and so that I can create or reattach to a tmux session in an nvim float, even though that nvim usually runs inside tmux),
— a bind to force-reload a pane if (when!) a command hangs.
For switching between tabs, I find that the ideal bind is simply Cmd + pane number. There’s never more than ten tabs that I’d often want to switch to within a single session. The highest number is probably four tabs. Each tab is typically assigned a high-level part of the project.
[0] I always forget what terminology a given multiplexer uses, so let’s just call them “panes” and “tabs”.
https://github.com/cmpadden/dotfiles/blob/6e767691a6b1295260...
unbind C-b
set-option -g prefix C-Space
bind-key C-Space send-prefixVery handy when you make a typo far into a long password and can't keep track of whether you've mashed backspace enough.
edit: oh, and I think Ctrl-space is the keystroke to get a nul character, and vi uses that character to insert the last entered piece of text in insert mode. It looks like Ctrl-@ does the same things, but tmux might not be able to tell the difference either.
This lets you put your theme colors in a different file, such as `source-file "~/.config/tmux/theme.conf"` and then your theme switching external script or tool can symlink a specific theme's tmux file to that path.
That's what I do in my dotfiles:
# Main tmux config
https://github.com/nickjj/dotfiles/blob/master/.config/tmux/tmux.conf
# One of the theme files
https://github.com/nickjj/dotfiles/blob/master/themes/tokyonight-moon/tmux.conf
It allows for hot-reloading different themes as well.