-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
97 lines (80 loc) · 2.81 KB
/
.tmux.conf
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
################################
# Keybinds
###############################
unbind-key c-b
set -g prefix C-space
bind-key C-space send-prefix
set -g history-limit 10000 # scrollback size
set -g base-index 1 # set index 1 (not 0) to map more to the keyboard layout
set -g pane-base-index 1
# source .tmux.conf with r
bind r source-file ~/.tmux.conf
# split panes using | and -
bind \\ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# Vim like copy mode
setw -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind P paste-buffer
# Vim like navigation
# bind-key h select-pane -L
# bind-key j select-pane -D
# bind-key k select-pane -U
# bind-key l select-pane -R
not_tmux="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?(g?(view|n?vim?x?)(diff)?|fzf)$'"
bind-key -n C-h if "$not_tmux" { send-keys C-h } {
if -F '#{==:#{pane_at_left},1}' {
run 'yabai -m window --focus west || yabai -m display --focus west || true'
} {
select-pane -L
}
}
bind-key -n C-j if "$not_tmux" { send-keys C-j } {
if -F '#{==:#{pane_at_bottom},1}' {
run 'yabai -m window --focus south || true'
} {
select-pane -D
}
}
bind-key -n C-k if "$not_tmux" { send-keys C-k } {
if -F '#{==:#{pane_at_top},1}' {
run 'yabai -m window --focus north || true'
} {
select-pane -U
}
}
bind-key -n C-l if "$not_tmux" { send-keys C-l } {
if -F '#{==:#{pane_at_right},1}' {
run 'yabai -m window --focus east || yabai -m display --focus east || true'
} {
select-pane -R
}
}
## Status bar
set-option -g status-position top
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'dreamsofcode-io/catppuccin-tmux'
set -g @plugin 'tmux-plugins/tmux-sensible'
# set -g @plugin 'christoomey/vim-tmux-navigator'
# Color
set -g @catppuccin_flavour 'mocha'
set -g @catppuccin_window_tabs_enabled off
# Resize Panes
bind-key -r -T prefix M-Up resize-pane -U 5
bind-key -r -T prefix M-Down resize-pane -D 5
bind-key -r -T prefix M-Left resize-pane -L 5
bind-key -r -T prefix M-Right resize-pane -R 5
bind-key -r -T prefix C-Up resize-pane -U
bind-key -r -T prefix C-Down resize-pane -D
bind-key -r -T prefix C-Left resize-pane -L
bind-key -r -T prefix C-Right resize-pane -R
#GIT
bind g popup -d "#{pane_current_path}" -xC -yC -w80% -h80% -E lazygit
bind G run-shell "tmux switch-client -t gh-dash || tmux new-session -d -s gh-dash -c '$HOME/code/dlvhdr/gh-dash' gh dash && tmux switch-client -t gh-dash"
bind L switch-client -l
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'