diff --git a/dotfiles/zsh/conf.d/tmux.zsh b/dotfiles/zsh/conf.d/tmux.zsh deleted file mode 100755 index 2a85b1e..0000000 --- a/dotfiles/zsh/conf.d/tmux.zsh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env zsh - -# Disabled until I fix my tmux config -return - -if [ "$TERM" = "xterm-256color" ] && [ -x "$(command -v tmux)" ]; then - tmux new-session -fi - diff --git a/hosts/workstation/default.nix b/hosts/workstation/default.nix index b9d1270..7b84dae 100644 --- a/hosts/workstation/default.nix +++ b/hosts/workstation/default.nix @@ -17,6 +17,7 @@ ../../modules/packages/firefox.nix ../../modules/packages/zsh.nix ../../modules/packages/fastfetch.nix + ../../modules/packages/tmux.nix ]; boot.loader.efi.canTouchEfiVariables = true; diff --git a/hosts/x220/default.nix b/hosts/x220/default.nix index f6301dd..9859971 100644 --- a/hosts/x220/default.nix +++ b/hosts/x220/default.nix @@ -15,6 +15,7 @@ ../../modules/packages/firefox.nix ../../modules/packages/zsh.nix ../../modules/packages/fastfetch.nix + ../../modules/packages/tmux.nix ]; boot = { diff --git a/modules/packages/tmux.nix b/modules/packages/tmux.nix index 9b5a2ae..e1e20a1 100644 --- a/modules/packages/tmux.nix +++ b/modules/packages/tmux.nix @@ -1,16 +1,38 @@ -{ ... }: +{ pkgs, ... }: { - # TODO: Port changes over from dots and streamline workflow programs.tmux = { enable = true; - prefix = "C-Space"; customPaneNavigationAndResize = true; baseIndex = 1; + plugins = with pkgs; [ + tmuxPlugins.resurrect + ]; extraConfig = '' - bind v split-window -v - bind c split-window -h - bind n new-window + # Neovim + set-option -sg escape-time 10 + set-option -g focus-events on + + # vi mode + set -g mode-keys vi + set -g status-keys vi + + # Rebind prefix key to C-a + set -g prefix C-a + bind C-a send-prefix + unbind C-b + + # Clipboard + set -ga update-environment WAYLAND_DISPLAY + bind Escape copy-mode + bind p run-shell 'tmux set-buffer -- "$(wl-paste -t "text/plain;charset=utf-8")"; tmux paste-buffer' + bind -T copy-mode-vi 'v' send -X begin-selection + bind -T copy-mode-vi 'y' send -X copy-pipe 'wl-copy' + set -s set-clipboard off + + # Status bar + set -g status-style bg=default + set -g status-fg 4 ''; }; }