-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.nix
80 lines (68 loc) · 2.25 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{ pkgs, ... }:
{
programs.tmux = {
enable = true;
terminal = "xterm-256color";
historyLimit = 100000;
plugins = with pkgs;
[
tmuxPlugins.vim-tmux-navigator
tmuxPlugins.onedark-theme
];
extraConfig = ''
# Misc sets
set -g status-position top
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
set -g renumber-windows on
set-option -g detach-on-destroy off
# Fix coloring
set -as terminal-features ",xterm-256color:RGB"
# Remap prefix key
set -g prefix C-f
# Remap arrows to vim binds
set-window-option -g mode-keys vi
bind-key -r -T prefix C-h resize-pane -L 2
bind-key -r -T prefix C-j resize-pane -D 2
bind-key -r -T prefix C-k resize-pane -U 2
bind-key -r -T prefix C-l resize-pane -R 2
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# I don't use the window switcher
bind-key w choose-session
# Easy switching back and fourth between two sessions
unbind Space
bind-key Space switch-client -l
# Vim-like selection and copying
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# Remaps to mimic vim like window splitting
bind 'v' split-window -h -c "#{pane_current_path}"
bind 's' split-window -v -c "#{pane_current_path}"
unbind '"'
unbind '%'
# Some random workflow binds for navigation and remote work
bind-key g run-shell "bash ~/.scripts/tmux_zoxide.sh"
bind-key G run-shell "bash ~/.scripts/tmux_repo.sh"
bind-key C run-shell "bash ~/.scripts/tmux_remote.sh window"
bind-key V run-shell "bash ~/.scripts/tmux_remote.sh hori"
bind-key S run-shell "bash ~/.scripts/tmux_remote.sh vert"
bind-key i neww bash -c "bash ~/.scripts/istolethis.sh"
# For remote work
bind -T root F12 set prefix None \;\
set key-table off \;\
set -g status off
bind -T off F12 set -u prefix \;\
set -u key-table \;\
set -g status on
'';
};
}