aboutsummaryrefslogtreecommitdiffhomepage
path: root/home-manager
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2023-06-18 21:49:04 +0900
committernsfisis <nsfisis@gmail.com>2023-09-01 09:25:39 +0900
commitf1e3ca6f971c2c5177174896e1fa3e6f695ca2a1 (patch)
treeb31e333930788d70b95869d20a29fef39c0faa35 /home-manager
parent22ddc1d4c1a06694997459f699818f20f2286798 (diff)
downloaddotfiles-f1e3ca6f971c2c5177174896e1fa3e6f695ca2a1.tar.gz
dotfiles-f1e3ca6f971c2c5177174896e1fa3e6f695ca2a1.tar.zst
dotfiles-f1e3ca6f971c2c5177174896e1fa3e6f695ca2a1.zip
home-manager: manage tmux
Diffstat (limited to 'home-manager')
-rw-r--r--home-manager/config/tmux/tmux.conf83
-rw-r--r--home-manager/home.nix30
2 files changed, 113 insertions, 0 deletions
diff --git a/home-manager/config/tmux/tmux.conf b/home-manager/config/tmux/tmux.conf
new file mode 100644
index 0000000..e1715cd
--- /dev/null
+++ b/home-manager/config/tmux/tmux.conf
@@ -0,0 +1,83 @@
+###################################################################
+# __ __ _ __ #
+# | \/ |_ _ | |_ _ __ ___ _ ___ __ ___ ___ _ __ / _| #
+# | |\/| | | | | | __| '_ ` _ \| | | \ \/ / / __/ _ \| '_ \| |_ #
+# | | | | |_| | | |_| | | | | | |_| |> < | (_| (_) | | | | _| #
+# |_| |_|\__, | (_)__|_| |_| |_|\__,_/_/\_(_)___\___/|_| |_|_| #
+# |___/ #
+###################################################################
+
+# OPTIONS {{{1
+
+# BASICS {{{2
+set-option -g renumber-windows on
+set-option -g focus-events on
+
+# TERMINAL FEATURES {{{2
+set-option -ga terminal-overrides ',tmux-256color:Tc'
+set-option -ga terminal-overrides ',alacritty:RGB'
+
+# APPEARANCE {{{2
+set-option -g status-justify left
+set-option -g status-style 'fg=#b1b1c8 bg=#101020'
+set-option -g status-left '#{?#{==:#{pane_mode},copy-mode},#[bg=#deab52] COPY ,#[bg=#6e6eff] TMUX }'
+set-option -g status-left-length 20
+set-option -g status-left-style 'fg=#101020 bold'
+set-option -g status-position top
+set-option -g status-right ' %F (%a) %R '
+set-option -g status-right-length 25
+set-option -g status-right-style 'fg=#b1b1c8 bg=#353535'
+set-option -g window-status-separator ''
+set-option -g window-status-format ' #W '
+set-option -g window-status-style 'fg=#8686bf bg=#101020'
+set-option -g window-status-current-format ' #W '
+set-option -g window-status-current-style 'fg=#b1b1c8 bg=#353535'
+
+set-option -g pane-border-lines single
+
+
+# KEY BINDINGS {{{1
+
+unbind-key -a -T root
+unbind-key -a -T prefix
+
+set-option -g status-keys emacs
+
+bind-key : command-prompt
+bind-key ';' command-prompt
+bind-key ? list-keys
+
+# Window
+bind-key t new-window
+bind-key n next-window
+bind-key p previous-window
+bind-key N move-window -a
+bind-key P move-window -b
+
+# Pane
+bind-key w switch-client -T tw
+bind-key -T tw h split-window -h -b
+bind-key -T tw j split-window -v
+bind-key -T tw k split-window -v -b
+bind-key -T tw l split-window -h
+bind-key h select-pane -L
+bind-key j select-pane -D
+bind-key k select-pane -U
+bind-key l select-pane -R
+bind-key g display-panes -d 0
+
+# Layout
+bind-key = select-layout tiled
+bind-key 4 split-window \; \
+ split-window \; \
+ split-window \; \
+ select-layout tiled
+
+set-option -g mode-keys vi
+bind-key V copy-mode
+bind-key -T copy-mode-vi V send-keys -X select-line
+bind-key -T copy-mode-vi Escape send-keys -X clear-selection
+# This is configured by home-manager.
+# bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "<clipboard copy command>"
+
+bind-key s set-option synchronize-panes
diff --git a/home-manager/home.nix b/home-manager/home.nix
index c24fb0a..ddbcac9 100644
--- a/home-manager/home.nix
+++ b/home-manager/home.nix
@@ -53,4 +53,34 @@ in
enable = true;
nix-direnv.enable = true;
};
+
+ programs.tmux = {
+ enable = true;
+
+ sensibleOnTop = false;
+
+ aggressiveResize = true;
+ baseIndex = 1;
+ clock24 = true;
+ escapeTime = 0;
+ historyLimit = 50000;
+ mouse = false;
+ prefix = "C-t";
+ terminal = "tmux-256color";
+
+ extraConfig = (
+ let
+ commonConfig = builtins.readFile ./config/tmux/tmux.conf;
+ extraConfig = if isWayland then
+ ''
+ bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy"
+ ''
+ else
+ ''
+ bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
+ '';
+ in
+ commonConfig + extraConfig
+ );
+ };
}