well, it started from one of theprimeagen's video.
at around the same time i'd been playing with split keyboards,
and discovered that switching tmux panels with ctrl+b n
is far more
convenient, than switching the iterm tabs with cmd+shift+arrow
.
and about quite some bit of a time later, i found myself extremely frustrated by the fact the i have to manually keep my iterm and terminator keybindings in sync, just to stay sane when jumping between machines.
and then i finally realized that i can use tmux for tabs, with the same keybindings, on all my machines!
and then tmux-sessionizer kicked in.
at that time i've been contriuting to dozen or so small repositories (they call it microservices), and tmux-sessionizer was just perfect for my style of work.
i've mapped ctrl+f
in zsh, and ctrl+b f
in tmux to a sessionizer, ctrl-b b
was for switching back-and-forth between tabs, and "ctrl-b v/n" for previous
(left) and next (right) tabs. and this was my setup until i met
vim-tmux-navigator.
with navigator ctrl+hjkl
became the only way to deal with panels/splits.
then i realized that not only the control key is cross-platfrom, we also have
alt. not so long before alt+jk
been assigned to switch tabs in tmux. short
after that, it appeared that terminal emulators handle the alt key in different
ways, but often you could configure the behavior. at this exact moment i found
myself in a delicate situation where i have to synchronize the configuration
between iterm and urxvt, just to stay sane when switching machines.
and the answer to that was ghostty. the terminal emulator itself works quite well on linux and macos, and keybindings were exactly the same, because both platforms use the same config file, loading it from the same path. what a lucky day, my beloved dotfilers!
and now it just a single, borderless, full-screen ghostty window, available by a single caps-lock key press, on both platfroms!
what else? ctrl+\
(without the prefix key) to open the "aux" session, with
"just" terminals to dig into a local system, apt here, ssh there, you know.
the "copy-mode" is synchronized with a system clipboard via osc52.
script for clock and battery level indicators in status-right
:
#!/bin/zsh
# tmux use this to fill the right panel with the mission-critical data
#
# set-option -g status-right '#[bg=#818181] #(/home/alex/src/dotfiles/shared/tmux-status.zsh) '
date=$(date +%H:%M)
bat=$(cat /sys/class/power_supply/BAT0/capacity)
if [[ $bat -lt 20 ]]; then
bat="⚠️$bat%"
elif [[ $bat -lt 10 ]]; then
bat="🚨$bat%🚨"
else
bat="$bat%"
fi
echo -n "[$bat] $date"
diy color scheme (full of millenial grey):
# colors
set-option -g status-justify left
set-option -g status-left '#[bg=#818181] #S #[bg=#272727] '
set-option -g status-left-length 16
set-option -g status-bg '#272727'
set-option -g status-right '#[bg=#818181] #(/home/alex/src/dotfiles/shared/tmux-status.zsh) '
set-option -g status-interval 60
# active tab
setw -g window-status-current-style 'fg=#000000 bg=#666666'
setw -g window-status-current-format ' #I #W '
# other tabs
setw -g window-status-style 'fg=#666666 bg=colour236'
setw -g window-status-format ' #I #W '
# message text
set -g message-style 'bg=#cccccc fg=black'
set-window-option -g pane-border-status off
# border colours
set -g pane-border-style "fg=#272727"
set -g pane-active-border-style "bg=default fg=#272727"