Files
nix-los/home/modules/tmux.nix

102 lines
2.4 KiB
Nix

{ config, lib, pkgs, ... }:
{
programs.tmux = {
enable = true;
# Shell and terminal
shell = "${pkgs.zsh}/bin/zsh";
terminal = "tmux-256color";
terminalOverrides = [ "*256col*:Tc" ];
# Indexing
baseIndex = 1;
paneBaseIndex = 1;
renumberWindows = true;
# Mouse and clipboard
mouse = false;
setClipboard = true;
# History
historyLimit = 50000;
# Status bar
statusInterval = 1;
statusPosition = "top";
statusJustify = "left";
statusStyle = "bg=black,fg=brightwhite";
statusLeft = "#[bg=colour236,fg=brightwhite]#{?session_path, #(basename #{session_path}) ,}";
statusRight = "#[bg=colour236,fg=brightwhite] #H #[bg=colour235,fg=brightwhite] %H:%M:%S ";
statusLeftLength = 100;
statusRightLength = 100;
# Window styling
windowStatusFormat = " #[fg=white]#I:#[fg=white]#W#{?window_flags,#F,} ";
windowStatusCurrentFormat = "#[bg=colour235,fg=brightred,bold] #I:#W#{?window_flags,#F,} ";
windowStatusSeparator = "";
# Pane styling
paneActiveBorderStyle = "fg=brightred";
paneBorderStyle = "fg=colour238";
# Message styling
messageStyle = "bg=colour236,fg=brightwhite";
messageCommandStyle = "bg=colour236,fg=brightwhite";
# Mode and clock
modeStyle = "bg=brightred,fg=black";
clockModeColour = "brightred";
clockModeStyle = 24;
# Copy mode
copyMode = {
vi = true;
};
# Keybindings
keyBindings = [
{
key = "y";
command = "copy-mode";
}
{
key = "h";
command = "select-pane -L";
options = { repeat = true; };
}
{
key = "j";
command = "select-pane -D";
options = { repeat = true; };
}
{
key = "k";
command = "select-pane -U";
options = { repeat = true; };
}
{
key = "l";
command = "select-pane -R";
options = { repeat = true; };
}
{
key = "r";
command = "source-file ~/.config/tmux/tmux.conf \\; display-message \"tmux.conf reloaded\"";
options = { repeat = true; };
}
{
key = "q";
command = "display-popup -E -w 60% -h 60% -d '#{session_path}' 'nvim quicknote.md'";
}
];
# Additional settings via extraConfig
extraConfig = ''
set -ga terminal-overrides ",*256col*:Tc"
set -g focus-events on
set -g pane-border-lines heavy
'';
};
}