~sumner/nixos-configuration

ref: 7e558d0d52b4201b2e0b7de2eb1a2d75fab02a2e nixos-configuration/modules/programs/tmux.nix -rw-r--r-- 764 bytes
7e558d0dSumner Evans matrix-synapse: email config for nevarro 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ pkgs, ... }: {
  programs.tmux = {
    enable = true;
    escapeTime = 0;
    extraConfig = ''
      set -g default-shell ${pkgs.zsh}/bin/zsh

      # Use Alt-HJKL to move around between vim panes and tmux windows.
      is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
          | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
      bind -n M-h if-shell "$is_vim" 'send-keys M-h' 'select-pane -L'
      bind -n M-j if-shell "$is_vim" 'send-keys M-j' 'select-pane -D'
      bind -n M-k if-shell "$is_vim" 'send-keys M-k' 'select-pane -U'
      bind -n M-l if-shell "$is_vim" 'send-keys M-l' 'select-pane -R'

      # Open a new window with Alt-Enter
      bind -n M-Enter split-window -h

      # Use the mouse
      set -g mouse on
    '';
  };
}