diff --git a/hosts/luci/home-config.nix b/hosts/luci/home-config.nix index 02d98b1..7b9558f 100644 --- a/hosts/luci/home-config.nix +++ b/hosts/luci/home-config.nix @@ -12,6 +12,7 @@ git.enable = true; neovim.enable = true; starship.enable = true; + tmux.enable = true; utils.enable = true; vifm.enable = true; zellij.enable = true; diff --git a/modules/home-manager/cli/tmux/default.nix b/modules/home-manager/cli/tmux/default.nix new file mode 100644 index 0000000..c52da09 --- /dev/null +++ b/modules/home-manager/cli/tmux/default.nix @@ -0,0 +1,67 @@ + +{ lib, config, pkgs, ... }: +with lib; +let + cfg = config.modules.cli.tmux; +in +{ + options.modules.cli.tmux = { + enable = mkEnableOption "enable Tmux"; + }; + config = mkIf cfg.enable { + programs.tmux = { + enable = true; + aggressiveResize = true; + baseIndex = 1; + customPaneNavigationAndResize = false; + escapeTime = 0; + focusEvents = true; + keyMode = "vi"; + mouse = true; + prefix = "C-a"; + terminal = "tmux-256color"; + extraConfig = '' + + bind -n -N "Select pane to the left of the active pane" M-h select-pane -L + bind -n -N "Select pane below the active pane" M-j select-pane -D + bind -n -N "Select pane above the active pane" M-k select-pane -U + bind -n -N "Select pane to the right of the active pane" M-l select-pane -R + + bind -n -r -N "Resize the pane left by 5" M-H resize-pane -L 5 + bind -n -r -N "Resize the pane down by 5" M-J resize-pane -D 5 + bind -n -r -N "Resize the pane up by 5" M-K resize-pane -U 5 + bind -n -r -N "Resize the pane right by 5" M-L resize-pane -R 5 + bind -n -n M-n split-window -h -c "#{pane_current_path}" + bind -n -n M-N split-window -v -c "#{pane_current_path}" + + # Theme + set -g status-interval 2 + setw -g automatic-rename on # rename window to reflect current program + set -g renumber-windows on # renumber windows when a window is closed + set -g set-titles on + set -g mode-style bg=colour10,fg=colour13 + set -g set-titles-string "#T" + set -g status-bg colour0 + set -g status-fg colour7 + set -g message-style bg=colour10,fg=colour7 + + setw -g window-status-current-format '#[fg=colour10,bg=colour3] #I\ + #[bg=colour10,fg=colour7,bold] #W\ + #{?window_active,󰎂 ,}#{?window_marked_flag,󰃃 ,}#{?window_activity_flag, ,}#{?window_silence_flag,󰝟 ,}#{?window_zoomed_flag,󱀅 ,}#{?window_bell_flag,#[fg=colour1]󱈸 ,}' + + set -g pane-border-style fg=colour11 + set -g pane-active-border-style fg=colour4 + + setw -g window-status-format '#[bg=color4,fg=colour10] #I\ + #[bg=colour10,fg=colour12] #W\ + #{?window_last_flag, ,}#{?window_marked_flag,󰃃 ,}#{?window_activity_flag, ,}#{?window_silence_flag,󰝟 ,}#{?window_zoomed_flag,󱀅 ,}#{?window_bell_flag,#[fg=colour1]󱈸 ,}' + set -g status-left "#[bg=colour0, fg=colour6]  #S " + set -g status-right "" + ''; + plugins = with pkgs; [ + tmuxPlugins.tmux-fzf + ]; + }; + }; +} + diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 6cd1619..8ca3f0b 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -11,6 +11,7 @@ ./cli/git ./cli/neovim ./cli/starship + ./cli/tmux ./cli/utils ./cli/vifm ./cli/zellij