-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
122 lines (90 loc) · 4.24 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# TRUE COLOR
# https://sunaku.github.io/tmux-23bit-color.html#usage
# This setup obsoletes `set -g default-terminal "screen-256color"`
set -g default-terminal "xterm-kitty"
# Cursor shape forwarding overrides.
# https://github.com/neovim/neovim/wiki/FAQ#how-can-i-change-the-cursor-shape-in-the-terminal
# Tell tmux to forward cursor shape escape sequences. Otherwise, it captures them.
set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
set-option -g history-limit 30000
set-option -g main-pane-height 10
# Macos copy
bind-key -T copy-mode-vi 'v' send -X begin-selection
# Use zsh.
set-option -g default-shell /bin/zsh
# Vi mode, and mouse mode, by default.
set -g status-keys vi
setw -g mode-keys vi
#bind-key -T copy-mode-vi 'v' send -X begin-selection
#bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "xclip -sel clip"
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" \; display-message "copied to system clipboard"
bind-key -T copy-mode-vi 'V' send -X rectangle-toggle
setw -g mouse on
#Vim pane motion
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Notify me what windows currently are doing things.
set -g monitor-activity off
set -g visual-bell on
#set -g activity-action none
set -g bell-action none
## Key bindings (must come after plugin install).
# Make it easy to reload tmux config.
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf!"
# Use C-a not C-b as prefix.
unbind C-b
unbind -n C-g
set -g prefix C-a
# Press C-a again to actually use C-a! Very nice.
bind C-a send-prefix
# Resize panes with capital vim keys.
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
bind -n M-- select-layout even-horizontal
bind -n M-= select-layout even-vertical
bind C-s split-window -vc "#{pane_current_path}"
bind C-v split-window -hc "#{pane_current_path}"
bind b set-option status
# Theme (Taken from https://github.com/dkeg/dots/blob/master/tmux.conf).
# Codepoints: · 00b7
setw -g window-status-format "#[bg=colour0]#[fg=colour3] · #[bg=colour0]#[fg=colour8] #I #W "
setw -g window-status-current-format "#[bg=colour0]#[fg=colour2] · #[bg=colour0]#[fg=colour7] #I #W "
set -g status-bg "#076678" # faded purple"#8f3f71" # Gruvbox colors: faded blue#"" A purple I happen to like: #B9A3DC"
set -g status-fg default
set -g status-position bottom
set -g status-justify right
set -g status-left ' '
set -g status-right ' '
# Shortcuts for editing configuration.
bind M-v neww -n nvimconf "nvim ~/.config/nvim/init.vim"
bind M-t neww -n tmuxconf "nvim ~/.tmux.conf"
bind M-s resize-pane -x 80
bind C-l kill-window
bind j join-pane
bind -n F2 choose-tree -wZ
# Don't wait 500ms before sending keys on to other programs! Otherwise <ESC> is slow in vim.
set -sg escape-time 0
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind-key -n F4 select-window -t "k9s"
bind-key -n F5 select-window -t "config-k8s"
bind -n F9 last-window
bind C-o rotate-window
bind-key -n M-o run "~/.config/tmux/org.zsh"
bind -n M-l neww "~/.config/tmux/switch-project.zsh"
bind -n M-m neww "~/.config/tmux/switch-project-shell.zsh"
bind -n F3 resize-pane -Z
#bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
#bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
#bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
#bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
#bind -n C-\\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"