aboutsummaryrefslogtreecommitdiff
path: root/programs
diff options
context:
space:
mode:
Diffstat (limited to 'programs')
-rw-r--r--programs/tmux.nix57
1 files changed, 51 insertions, 6 deletions
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
20 env TZ=Europe/London date +"%H%M" 20 env TZ=Europe/London date +"%H%M"
21 ''; 21 '';
22 22
23 # plugins
24 thumbs = {
25 plugin = pkgs.tmuxPlugins.tmux-thumbs;
26 extraConfig = ''
27 set -g @thumbs-key F
28 set -g @thumbs-command 'echo -n {} | xclip -i -sel p -f | xclip -i -sel c'
29 set -g @thumbs-fg-color white
30 set -g @thumbs-hint-bg-color yellow
31 set -g @thumbs-hint-fg-color black
32 set -g @thumbs-position left
33 set -g @thumbs-alphabet colemak-homerow
34 '';
35 };
36
37 resurrect = {
38 plugin = pkgs.tmuxPlugins.resurrect;
39 extraConfig =
40 let
41 processes = builtins.map (name: ''"~${name}->${name}"'') [
42 ".firefox-wrapped"
43 "weechat --run-command ;"
44 ];
45 in
46 ''
47 set -g @resurrect-strategy-nvim 'session'
48 set -g @resurrect-strategy-vim 'session'
49 set -g @resurrect-dir '~/.local/share/tmux/resurrect'
50 set -g @resurrect-processes '${builtins.toString processes}'
51 set -g @resurrect-strategy-nvim 'session'
52 '';
53 };
54
55 continuum = {
56 plugin = pkgs.tmuxPlugins.continuum;
57 extraConfig = ''
58 set -g @continuum-restore 'on'
59 set -g @continuum-save-interval '20' # minutes
60 '';
61 };
62
23in 63in
24{ 64{
25 programs.tmux = { 65 programs.tmux = {
26 enable = true; 66 enable = true;
27 plugins = with pkgs; [ 67 plugins = [ thumbs resurrect continuum ];
28 tmuxPlugins.fingers 68 prefix = "C-t";
29 ]; 69 keyMode = "vi";
70 terminal = "xterm-256color-italic";
30 extraConfig = '' 71 extraConfig = ''
31 set -g prefix C-t
32 setw -g mode-keys vi
33 unbind-key C-b 72 unbind-key C-b
34 bind-key C-t send-prefix 73 bind-key C-t send-prefix
35 74
36 bind r source-file ~/.config/tmux/tmux.conf 75 bind r source-file ~/.config/tmux/tmux.conf
37 76
38 set-option -g default-terminal xterm-256color-italic
39 set escape-time 20 77 set escape-time 20
40 78
41 set -g mouse on 79 set -g mouse on
@@ -43,6 +81,13 @@ in
43 set -g base-index 1 81 set -g base-index 1
44 setw -g pane-base-index 1 82 setw -g pane-base-index 1
45 83
84 # session jumper
85 bind-key j display-popup -E "\
86 tmux list-sessions -F '#{session_name}' |\
87 fzf |\
88 xargs tmux switch-client -t"
89
90
46 # pane binds 91 # pane binds
47 unbind-key E 92 unbind-key E
48 bind-key h select-pane -L 93 bind-key h select-pane -L