aboutsummaryrefslogtreecommitdiff
path: root/programs/tmux.nix
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-09-26 16:56:36 +0100
committerAkshay <[email protected]>2021-09-26 16:56:36 +0100
commit5cdb4e421a809de51c3ebe8404e50d732721238b (patch)
tree73b71617c41b3e13edbf26035e821bb884d30441 /programs/tmux.nix
init
Diffstat (limited to 'programs/tmux.nix')
-rw-r--r--programs/tmux.nix85
1 files changed, 85 insertions, 0 deletions
diff --git a/programs/tmux.nix b/programs/tmux.nix
new file mode 100644
index 0000000..58369da
--- /dev/null
+++ b/programs/tmux.nix
@@ -0,0 +1,85 @@
1{ config
2, pkgs
3, ...
4}:
5
6{
7 programs.tmux = {
8 enable = true;
9 plugins = with pkgs; [
10 tmuxPlugins.fingers
11 ];
12 extraConfig = ''
13 set -g prefix C-a
14 setw -g mode-keys vi
15 unbind-key C-b
16 bind-key C-a send-prefix
17
18 bind r source-file ~/.tmux.conf
19
20 set-option -g default-terminal xterm-256color-italic
21 set escape-time 20
22
23 set -g mouse on
24
25 set -g base-index 1
26 setw -g pane-base-index 1
27
28 # pane binds
29 bind-key h select-pane -L
30 bind-key j select-pane -D
31 bind-key k select-pane -U
32 bind-key l select-pane -R
33 bind-key -r H resize-pane -L 5
34 bind-key -r J resize-pane -D 5
35 bind-key -r K resize-pane -U 5
36 bind-key -r L resize-pane -R 5
37
38 # window binds
39 bind -n M-h previous-window
40 bind -n M-l next-window
41 bind-key "|" split-window -h -c "#{pane_current_path}"
42 bind-key "-" split-window -v -c "#{pane_current_path}"
43 bind-key s choose-session
44 bind-key c new-window -c "#{pane_current_path}"
45 bind-key ) swap-window -t +1
46 bind-key ( swap-window -t -1
47 bind-key [ copy-mode
48
49 # statusline hide / unhide
50 bind -n M-down set -q status off
51 bind -n M-up set -q status on
52
53 bind-key -r "<" swap-window -d -t -1
54 bind-key -r ">" swap-window -d -t +1
55
56 bind-key -T copy-mode-vi v send-keys -X begin-selection
57 bind-key -T copy-mode-vi y send-keys -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c "
58 bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
59 bind P paste-buffer
60
61 bind E command-prompt -p "Command:" \
62 "run \"tmux list-panes -a -F '##{session_name}:##{window_index}.##{pane_index}' \
63 | xargs -I PANE tmux send-keys -t PANE '%1' Enter\""
64
65 set-window-option -g allow-rename off
66
67 set -g pane-border-style fg=colour11
68 set -g pane-active-border-style fg=colour8
69
70 set -g status-justify right
71 set -g status-right ""
72 set -g status-style "bg=colour0"
73 set -ag status-style "fg=colour7"
74
75 set -g window-status-current-format " #[fg=colour15]#W#{?window_zoomed_flag, #[fg=colour2]+,}#{?window_activity_flag, #[fg=colour3]!,}"
76 set -g window-status-format " #[fg=colour8]#W#{?window_zoomed_flag, #[fg=colour2]+,}"
77
78
79 set -g status-left-length 100
80 set -g status-left "#[fg=colour15]#(date +"%H%M") #[fg=colour8]hrs "
81 set -ag status-left "#[fg=colour15]#(date +"%d/%m")#[fg=colour8] #(date +"%Y") "
82 set -ag status-left "#[fg=colour7]#(~/scripts/bat -q)#[fg=colour12]"
83 '';
84 };
85}