about summary refs log tree commit diff
path: root/modules/common/tmux.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-02-19 17:50:35 +0300
committerAzat Bahawi <azat@bahawi.net>2023-02-19 17:50:35 +0300
commit91fb4f28ef5d87e8bcf7749928d30ba4a9cbbd34 (patch)
treee07291fcb1cf62a561ffe58d1fd8e2968ff6fcb3 /modules/common/tmux.nix
parent2023-02-15 (diff)
2023-02-19
Diffstat (limited to 'modules/common/tmux.nix')
-rw-r--r--modules/common/tmux.nix60
1 files changed, 60 insertions, 0 deletions
diff --git a/modules/common/tmux.nix b/modules/common/tmux.nix
new file mode 100644
index 0000000..e978f72
--- /dev/null
+++ b/modules/common/tmux.nix
@@ -0,0 +1,60 @@
+{
+  config,
+  lib,
+  ...
+}:
+with lib; let
+  cfg = config.nixfiles.modules.tmux;
+in {
+  options.nixfiles.modules.tmux.enable =
+    mkEnableOption "tmux";
+
+  config = mkIf cfg.enable {
+    hm.programs.tmux = {
+      enable = true;
+
+      aggressiveResize = true;
+      baseIndex = 1;
+      clock24 = true;
+      disableConfirmationPrompt = true;
+      escapeTime = 0;
+      historyLimit = 50000;
+      newSession = true;
+      resizeAmount = 10;
+      terminal = "screen-256color";
+
+      extraConfig = ''
+        set -g set-titles on
+
+        set -g status-left  ""
+        set -g status-right ""
+
+        set -g detach-on-destroy off
+
+        set -g status-keys emacs
+        set -g mode-keys   vi
+
+        bind h select-pane -L
+        bind j select-pane -D
+        bind k select-pane -U
+        bind l select-pane -R
+
+        bind -r H resize-pane -L 10
+        bind -r J resize-pane -D 10
+        bind -r K resize-pane -U 10
+        bind -r L resize-pane -R 10
+
+        bind < swap-pane -D
+        bind > swap-pane -U
+
+        bind , swap-window -t -1
+        bind . swap-window -t +1
+
+        bind Tab last-window
+
+        bind _ split-window -v
+        bind | split-window -h
+      '';
+    };
+  };
+}

Consider giving Nix/NixOS a try! <3