diff --git a/nixos/home.nix b/nixos/home.nix index 4960282..7a6e376 100644 --- a/nixos/home.nix +++ b/nixos/home.nix @@ -7,6 +7,7 @@ [ ./modules/nixvim ./modules/fastfetch + ./modules/tmux/home.nix ] ++ lib.optional (hwconfig.useImpermanence) (import ./modules/impermanence/home.nix { inherit username; inherit inputs; } ) ++ lib.optional (config.programs.hyprland.enable) ./modules/hyprland/home.nix ++ lib.optional (builtins.pathExists ./homes/${username}) ./homes/${username}; diff --git a/nixos/modules/nixvim/default.nix b/nixos/modules/nixvim/default.nix index 50fe4d8..e65145c 100644 --- a/nixos/modules/nixvim/default.nix +++ b/nixos/modules/nixvim/default.nix @@ -8,6 +8,9 @@ enable = true; colorschemes.catppuccin.enable = true; plugins = { + tmux-navigator = { + enable = true; + }; cmp = { enable = true; autoEnableSources = true; diff --git a/nixos/modules/tmux/home.nix b/nixos/modules/tmux/home.nix new file mode 100644 index 0000000..d8a61df --- /dev/null +++ b/nixos/modules/tmux/home.nix @@ -0,0 +1,59 @@ +{ pkgs, ... }: +{ + programs.tmux = { + enable = true; + terminal = "tmux-256color"; + prefix = "C-Space"; + clock24 = true; + mouse = true; + keyMode = "vi"; + baseIndex = 1; + sensibleOnTop = true; + disableConfirmationPrompt = true; + plugins = with pkgs.tmuxPlugins; [ + vim-tmux-navigator + { + plugin = catppuccin; + extraConfig = '' + set -g @catppuccin_flavour 'mocha' + set -g @catppuccin_date_time "%H:%M" + ''; + } + { + plugin = resurrect; + extraConfig = '' + set -g @resurrect-strategy-vim 'session' + set -g @resurrect-strategy-nvim 'session' + set -g @resurrect-capture-pane-contents 'on' + ''; + } + { + plugin = continuum; + extraConfig = '' + set -g @continuum-restore 'on' + set -g @continuum-boot 'on' + set -g @continuum-save-interval '10' + ''; + } + yank + ]; + extraConfig = '' + # Shift Alt vim keys to switch windows + bind -n M-H previous-window + bind -n M-L next-window + # Use Alt-arrow keys without prefix key to switch panes + bind -n M-Left select-pane -L + bind -n M-Right select-pane -R + bind -n M-Up select-pane -U + bind -n M-Down select-pane -D + + # keybindings + 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}" + ''; + }; +}