nixos-config/home-manager/modules/tmux/default.nix

85 lines
2.3 KiB
Nix
Raw Normal View History

{ pkgs
, config
, lib
, ...
2022-03-01 22:19:03 +01:00
}:
with lib; let
cfg = config.eboskma.programs.tmux;
in
{
2021-11-21 19:07:12 +01:00
options.eboskma.programs.tmux = {
enable = mkEnableOption "enable tmux";
};
2022-05-03 18:17:38 +02:00
config = mkIf cfg.enable {
2021-11-21 19:07:12 +01:00
programs.tmux = {
enable = true;
2021-12-18 16:23:14 +01:00
prefix = "C-a";
2021-11-21 19:07:12 +01:00
terminal = "tmux-256color";
clock24 = true;
baseIndex = 1;
keyMode = "vi";
2021-12-18 16:23:14 +01:00
plugins = with pkgs.tmuxPlugins; [
sensible
tmux-fzf
{
plugin = dracula;
extraConfig = ''
2021-12-21 16:53:42 +01:00
set -g @dracula-refresh-rate 10
2021-12-18 16:23:14 +01:00
set -g @dracula-show-powerline true
set -g @dracula-show-fahrenheit false
2021-12-21 16:53:42 +01:00
set -g @dracula-show-left-icon session
set -g @dracula-network-bandwith "enp4s0"
set -g @dracula-military-time true
set -g @dracula-day-month true
set -g @dracula-plugins "time cpu-usage ram-usage network network-bandwith"
2021-12-18 16:23:14 +01:00
'';
}
];
2021-11-21 19:07:12 +01:00
extraConfig = ''
setw -g automatic-rename
set -ag update-environment "SWAYSOCK"
2021-12-18 16:23:14 +01:00
bind-key r source ~/.config/tmux/tmux.conf \; display "Reloaded config."
2021-11-21 19:07:12 +01:00
bind-key C-a send-prefix
bind-key | split-window -h
bind-key - split-window -v
bind-key h select-pane -L
bind-key n select-pane -D
bind-key e select-pane -U
bind-key i select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-i select-window -t :+
bind-key -r H resize-pane -L 5
bind-key -r N resize-pane -D 5
bind-key -r E resize-pane -U 5
bind-key -r I resize-pane -R 5
bind-key C-[ swap-window -t -1
bind-key C-] swap-window -t +1
bind-key -T copy-mode-vi h send-keys -X cursor-left
bind-key -T copy-mode-vi n send-keys -X cursor-down
bind-key -T copy-mode-vi e send-keys -X cursor-up
bind-key -T copy-mode-vi i send-keys -X cursor-right
set -g mouse on
bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind-key -n WheelDownPane select-pane -t= \; send-keys -M
'';
};
home.packages = with pkgs; [
powerline
2021-12-21 16:53:42 +01:00
bc
2021-11-21 19:07:12 +01:00
];
};
}