From 94cb0bbb73b489d32495566ceade49421f878d78 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 22 Jan 2023 22:08:41 +0530 Subject: tmux updates --- programs/tmux.nix | 57 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 6 deletions(-) (limited to 'programs') diff --git a/programs/tmux.nix b/programs/tmux.nix index e9e626b..5bc5355 100644 --- a/programs/tmux.nix +++ b/programs/tmux.nix @@ -20,22 +20,60 @@ let env TZ=Europe/London date +"%H%M" ''; + # plugins + thumbs = { + plugin = pkgs.tmuxPlugins.tmux-thumbs; + extraConfig = '' + set -g @thumbs-key F + set -g @thumbs-command 'echo -n {} | xclip -i -sel p -f | xclip -i -sel c' + set -g @thumbs-fg-color white + set -g @thumbs-hint-bg-color yellow + set -g @thumbs-hint-fg-color black + set -g @thumbs-position left + set -g @thumbs-alphabet colemak-homerow + ''; + }; + + resurrect = { + plugin = pkgs.tmuxPlugins.resurrect; + extraConfig = + let + processes = builtins.map (name: ''"~${name}->${name}"'') [ + ".firefox-wrapped" + "weechat --run-command ;" + ]; + in + '' + set -g @resurrect-strategy-nvim 'session' + set -g @resurrect-strategy-vim 'session' + set -g @resurrect-dir '~/.local/share/tmux/resurrect' + set -g @resurrect-processes '${builtins.toString processes}' + set -g @resurrect-strategy-nvim 'session' + ''; + }; + + continuum = { + plugin = pkgs.tmuxPlugins.continuum; + extraConfig = '' + set -g @continuum-restore 'on' + set -g @continuum-save-interval '20' # minutes + ''; + }; + in { programs.tmux = { enable = true; - plugins = with pkgs; [ - tmuxPlugins.fingers - ]; + plugins = [ thumbs resurrect continuum ]; + prefix = "C-t"; + keyMode = "vi"; + terminal = "xterm-256color-italic"; extraConfig = '' - set -g prefix C-t - setw -g mode-keys vi unbind-key C-b bind-key C-t send-prefix bind r source-file ~/.config/tmux/tmux.conf - set-option -g default-terminal xterm-256color-italic set escape-time 20 set -g mouse on @@ -43,6 +81,13 @@ in set -g base-index 1 setw -g pane-base-index 1 + # session jumper + bind-key j display-popup -E "\ + tmux list-sessions -F '#{session_name}' |\ + fzf |\ + xargs tmux switch-client -t" + + # pane binds unbind-key E bind-key h select-pane -L -- cgit v1.2.3