From 5407310cb454d1723d0b2a4beed4596f8e762ac5 Mon Sep 17 00:00:00 2001 From: foglar Date: Tue, 3 Dec 2024 08:35:45 +0100 Subject: [PATCH] tmux config fix --- nixos/packages/tools/tmux.nix | 48 ++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/nixos/packages/tools/tmux.nix b/nixos/packages/tools/tmux.nix index c1ed477..9cbb558 100644 --- a/nixos/packages/tools/tmux.nix +++ b/nixos/packages/tools/tmux.nix @@ -5,18 +5,32 @@ ... }: { options = { - programs.tmux.enable = lib.mkEnableOption "tmux"; + program.tmux.enable = lib.mkEnableOption "tmux"; }; - config = lib.mkIf config.programs.tmux.enable { + config = lib.mkIf config.program.tmux.enable { programs.tmux = { enable = true; clock24 = true; terminal = "screen-256color"; + shortcut = "Space"; + plugins = [ - pkgs.tmuxPlugins.dracula - pkgs.tmuxPlugins.tpm + { + plugin = pkgs.tmuxPlugins.dracula; + extraConfig = '' + #set -g @dracula-show-powerline true + #set -g @dracula-show-flags true + set -g @dracula-plugins "cpu-usage ram-usage battery time" + set -g @dracula-show-left-icon session + set -g @dracula-battery-colors "red dark_gray" + set -g @dracula-show-timezone false + set -g @dracula-day-month true + set -g @dracula-military-time true + ''; + } + #pkgs.tmuxPlugins.tmux-fzf pkgs.tmuxPlugins.sensible pkgs.tmuxPlugins.yank @@ -24,24 +38,34 @@ ]; extraConfig = '' - # Set switching between windows simpler - unbind C-b - set -g prefix C-Space - bind C-Space send-prefix + set-option -sa terminal-overrides ",xterm*:Tc" + + # Set pane to top + set -g status-position top + + # Mouse enable + set -g mouse on + + # Start count on 1 instead of 0 + set -g base-index 1 + set -g pane-base-index 1 + set-window-option -g pane-base-index 1 + set-option -g renumber-windows only bind -n M-H previous-window bind -n M-L next-window - set -g status-position top - set-option -sa terminal-overrides ",xterm*:Tc" - set-option -g mouse on - + # set vi mode set-window-option -g mode-keys vi setw -g mode-keys vi + #keybindings for copying bind-key -T copy-mode-vi v send-keys -X begin-selection bind-key -T copy-mode-vi C-v send-keys -X rectangle toggle bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel + + bind '"' split-window -v -c "#{pane_current_path}" + bind % split-window -h -c "#{pane_current_path}" ''; }; };