tmux: handful of tweaks

This commit is contained in:
John Bowdre 2024-12-05 13:32:44 -06:00
parent c7859ce991
commit ce5454ff7a
Signed by: john
SSH key fingerprint: SHA256:cZYnOxaLdo+MhBNMX38ihO/p2Kek6fBykSFoJwHBhUo

View file

@ -1,13 +1,18 @@
{ pkgs, lib, ... }: { { pkgs, ... }: {
programs.tmux = { programs.tmux = {
enable = true; enable = true;
aggressiveResize = true;
baseIndex = 1; baseIndex = 1;
clock24 = true; clock24 = true;
customPaneNavigationAndResize = true;
escapeTime = 50; escapeTime = 50;
focusEvents = true;
historyLimit = 100000; historyLimit = 100000;
keyMode = "vi"; keyMode = "vi";
mouse = true; mouse = true;
plugins = with pkgs.tmuxPlugins; [ ]; plugins = with pkgs.tmuxPlugins; [
gruvbox
];
extraConfig = '' extraConfig = ''
# new panes inherit current working directory # new panes inherit current working directory
bind '%' split-window -h -c '#{pane_current_path}' bind '%' split-window -h -c '#{pane_current_path}'
@ -34,6 +39,10 @@
bind -n M-j previous-window # alt+j bind -n M-j previous-window # alt+j
bind -n M-k next-window # alt+k bind -n M-k next-window # alt+k
# auto window rename
set-option -g automatic-rename
set-option -g automatic-rename-format '#{pane_current_command}'
# display up to 20 chars of session name # display up to 20 chars of session name
set-option -g status-left-length 20 set-option -g status-left-length 20
@ -69,5 +78,13 @@
set-option -s set-clipboard on set-option -s set-clipboard on
''; '';
}; };
home.shellAliases = {
tm = "tmux";
tms = "tmux new -s";
tml = "tmux list-sessions";
tma = "tmux attach -t";
tmk = "tmux kill-session -t";
};
} }