about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--home/profiles/base/config/tmux.nix83
-rw-r--r--home/profiles/base/default.nix69
2 files changed, 124 insertions, 28 deletions
diff --git a/home/profiles/base/config/tmux.nix b/home/profiles/base/config/tmux.nix
new file mode 100644
index 0000000..5d50cc1
--- /dev/null
+++ b/home/profiles/base/config/tmux.nix
@@ -0,0 +1,83 @@
+''
+set -ga terminal-overrides ",*256col*:Tc"
+
+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 terminal title
+
+set -g display-panes-time 800 # slightly longer pane indicators display time
+set -g display-time 1000      # slightly longer status messages display time
+
+set -g status-interval 5     # redraw status line every 5 seconds
+
+# better split bindings
+unbind '"'
+unbind %
+# splitting
+bind f if-shell "[ $(($(tmux display -p '8*#{pane_width}-20*#{pane_height}'))) -lt 0 ]" "splitw -v -c '#{pane_current_path}'" "splitw -h -c '#{pane_current_path}' "
+
+# reload
+bind r source-file ~/.config/tmux/tmux.conf
+
+bind -n C-h select-pane -L
+bind -n C-j select-pane -D
+bind -n C-k select-pane -U
+bind -n C-l select-pane -R
+
+bind -n C-M-h resize-pane -L 2
+bind -n C-M-j resize-pane -D 2
+bind -n C-M-k resize-pane -U 2
+bind -n C-M-l resize-pane -R 2
+
+bind -n C-S-h swap-pane -U
+bind -n C-S-j swap-pane -U
+bind -n C-S-k swap-pane -D
+bind -n C-S-l swap-pane -D
+
+# prefix-m marks window, prefix-u swaps current with marked
+bind u swap-pane
+
+# kill current pane
+unbind x
+bind w kill-pane
+
+# pane separator style
+set -g pane-border-style "fg=black bg=terminal"
+set -g pane-active-border-style "fg=black bg=black"
+
+# new window on n, not c
+unbind c
+unbind n
+bind n new-window
+
+# enable mouse operation
+set -g mouse on
+
+# move status line to the top
+set-option -g status-position top
+
+set -g status-justify right
+
+# transparent status background
+set-option -g status-style bg=default
+
+# left side length and style
+set -g status-left-length 60
+set -g status-left-style default
+
+# display the session name
+set -g status-left "#[fg=green] ❐ #S #[default]"
+
+# right side length and style
+set -g status-right-length 140
+set -g status-right-style default
+set -g status-right ""
+
+# inactive window style
+set -g window-status-style fg=default,bg=default
+set -g window-status-format ' #I #W '
+# active window style
+set -g window-status-current-style fg=blue,bg=default
+set -g window-status-current-format ' #I #W '
+''
diff --git a/home/profiles/base/default.nix b/home/profiles/base/default.nix
index 5c427e2..0e1d873 100644
--- a/home/profiles/base/default.nix
+++ b/home/profiles/base/default.nix
@@ -10,7 +10,7 @@ in
   imports = [
     ../../modules/programs/nixpkgs
     ../../modules/programs/zshell
-    ../../modules/programs/zellij
+    #../../modules/programs/zellij
     ../../modules/misc/neotheme
   ];
 
@@ -103,6 +103,18 @@ in
 
       password-store.enable = true;
 
+      tmux = {
+        enable = true;
+
+        prefix = "C-f";
+        terminal = "xterm-256color";
+        shell = "${pkgs.zsh}/bin/zsh";
+        baseIndex = 1;
+        keyMode = "vi";
+
+        extraConfig = import ./config/tmux.nix;
+      };
+
       waybar = {
         enable = config.wayland.windowManager.sway.enable;
 
@@ -168,33 +180,34 @@ in
         enableZshIntegration = true;
       };
 
-      zellij = {
-        enable = true;
-
-        settings = {
-          default_mode = "normal";
-          pane_frames = false;
-          simplified_ui = true; # bitmap fonts
-
-          themes = {
-            default = {
-              # Industrial Jellybeans theme
-              bg = [ 21 21 21 ];
-              fg = [ 136 136 136 ];
-              black = [ 28 28 28 ];
-              gray = [ 64 64 64 ];
-              white = [ 232 232 211 ];
-              red = [ 141 61 38 ];
-              orange = [ 250 187 110 ];
-              yellow = [ 250 208 122 ];
-              green = [ 153 173 106 ];
-              blue = [ 129 151 191 ];
-              cyan = [ 143 191 220 ];
-              magenta = [ 198 182 238 ];
-            };
-          };
-        };
-      };
+      # TODO: https://github.com/zellij-org/zellij/issues/1013
+      # zellij = {
+      #   enable = true;
+      #
+      #   settings = {
+      #     default_mode = "normal";
+      #     pane_frames = false;
+      #     simplified_ui = true; # bitmap fonts
+      #
+      #     themes = {
+      #       default = {
+      #         # Industrial Jellybeans theme
+      #         bg = [ 21 21 21 ];
+      #         fg = [ 136 136 136 ];
+      #         black = [ 28 28 28 ];
+      #         gray = [ 64 64 64 ];
+      #         white = [ 232 232 211 ];
+      #         red = [ 141 61 38 ];
+      #         orange = [ 250 187 110 ];
+      #         yellow = [ 250 208 122 ];
+      #         green = [ 153 173 106 ];
+      #         blue = [ 129 151 191 ];
+      #         cyan = [ 143 191 220 ];
+      #         magenta = [ 198 182 238 ];
+      #       };
+      #     };
+      #   };
+      # };
     };
 
     services = {