/
tmux.nix
59 lines (49 loc) · 2.01 KB
/
tmux.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ pkgs, lib, ... }:
let
tmux-session = pkgs.callPackage ../pkgs/tmux-session { };
lazygit-window = pkgs.callPackage ../pkgs/lazygit-window { };
in {
home.packages = [ tmux-session lazygit-window ];
programs.tmux = {
enable = true;
terminal = "tmux-256color";
shortcut = "a";
keyMode = "vi";
secureSocket = false;
baseIndex = 1;
extraConfig = ''
set -ga terminal-overrides ",*col*:Tc"
# navigate around split panes with C-{h/j/k/l}
bind-key -n C-h select-pane -L
bind-key -n C-j select-pane -D
bind-key -n C-k select-pane -U
bind-key -n C-l select-pane -R
# quickly open CLI tools
bind h run-shell "${lazygit-window}/bin/lazygit-window"
bind j split-window -h ${tmux-session}/bin/tmux-jump
# get rid of the half-second escape time for kakoune's escape key
set -sg escape-time 25
# mouse
set -g mouse on
# open new terminals in the same working directory
bind '"' split-window -c "#{pane_current_path}"
bind '-' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind '|' split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind l select-layout main-vertical
# status line (thanks, Ju!)
set-option -g status-justify left
set-option -g status-left '#[bg=colour2] #[bg=colour8] #[bg=colour0] #S '
set-option -g status-left-length 16
set-option -g status-fg colour7
set-option -g status-bg colour0
set-option -g status-right '%a %R #[bg=colour8] #[bg=colour2] #[]'
set-option -g status-interval 60
set-option -g pane-active-border-style fg=colour8
set-option -g pane-border-style fg=colour238
set-window-option -g window-status-format '#[bg=colour8]#[fg=colour3] #I #[fg=colour15]#W#[fg=colour5]#F# '
set-window-option -g window-status-current-format '#[bg=colour8]#[fg=colour3] #I #[bg=colour7]#[fg=colour8] #W#[fg=colour0]#F #[bg=colour8]'
'';
};
}