-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmuxconf
133 lines (128 loc) · 4.94 KB
/
tmuxconf
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
123
124
125
126
127
128
129
130
131
132
133
####################################################################
# TmUX configuration
# https://github.com/ZwodahS/dotfiles
####################################################################
# unbind all keys
# If i am not using, don't even have them in the first place.
unbind-key -a
# Set the prefix to ^Q
set -g prefix ^Q
#### keep track of what keys i have used
# dhjklnoprtwxz [] <up> <down> <left> <right>
# WT
# ^ + hljmqrw
#################### basic stuffs #####################
# These section is important configuration
bind-key d detach
# WARNING : NESTED TMUX DESTROY YOUR SANITY
bind-key ^q send-prefix
# force a reload of the config file
bind-key ^r source-file ~/.tmux.conf
bind-key : command-prompt
bind-key ? list-keys
#################### session stuffs ####################
# switch tmux session
bind-key t command-prompt "switch-client -t %%"
# choose tmux session
bind-key T choose-session
#################### window stuffs ####################
bind-key n new-window -c '#{pane_current_path}' # new
bind-key z confirm-before kill-window # kill
bind-key r command-prompt "rename-window %%" # rename
bind-key W choose-window
bind-key 1 select-window -t :1
bind-key 2 select-window -t :2
bind-key 3 select-window -t :3
bind-key 4 select-window -t :4
bind-key 5 select-window -t :5
bind-key 6 select-window -t :6
bind-key 7 select-window -t :7
bind-key 8 select-window -t :8
bind-key 9 select-window -t :9
bind-key 0 command-prompt "select-window -t :%%"
# window swapping
bind-key ^h swap-window -dt -1
bind-key ^l swap-window -dt +1
#################### pane stuffs ####################
bind-key x confirm-before kill-pane # kill
bind-key w display-panes # selection
bind-key ^w display-panes # selection
bind-key | command-prompt "resize-pane -x %%" # resize width
bind-key _ command-prompt "resize-pane -y %%" # resize height
bind-key v split-window -h -c '#{pane_current_path}' # vertical split
bind-key s split-window -v -c '#{pane_current_path}' # horizontal split
# pane resizing, by factor of 2, 1 is too slow, 3 is too fast.
bind-key -r Up resize-pane -U 2
bind-key -r Down resize-pane -D 2
bind-key -r Left resize-pane -L 2
bind-key -r Right resize-pane -R 2
bind-key -r k select-pane -U
bind-key -r j select-pane -D
bind-key -r h select-pane -L
bind-key -r l select-pane -R
bind-key + resize-pane -Z # zoom
bind-key = resize-pane -Z # zoom
# pane swapping
bind-key ^k swap-pane -U
bind-key ^j swap-pane -D
# pane move to channel
bind-key ^m command-prompt "join-pane -t %%"
#################### buffer stuffs ####################
bind-key [ copy-mode
bind-key ] command-prompt "save-buffer -b 0 %%"
bind-key p paste-buffer
bind-key o choose-buffer
#################### Tmux configuration ####################
# Below from https://mutelight.org/practical-tmux
# start window numbering at 1
set -g base-index 1
# start pane numbering at 1
set -g pane-base-index 1
# Faster command sequences
set -g escape-time 0
set -g repeat-time 750
# Activity monitoring
set -g monitor-activity on
set -g visual-activity off
# Theme Tokyonight
## Set status bar
# set -g status-bg '#1f2335'
# set -g status-fg '#7aa2f7'
# ## Highlight active window
# set -g window-status-current-style bg='#e0af68',fg='#101010'
# set -g window-status-style bg='#3B4261',fg='#7aa2f7'
# set -g window-status-activity-style bg='#7dcfff',fg='#101010'
# set -g window-status-bell-style bg='#7dcfff',fg='#101010'
# ## Pane number display
# set-option -g display-panes-active-colour '#7aa2f7'
# set-option -g display-panes-colour '#3B4261'
# set -g pane-active-border-style "bg=#1f2335 fg=#7aa2f7"
# Theme Melange
set -g status-bg '#151414'
set -g status-fg '#FFFF00' # ????
# ## Highlight active window
set -g window-status-current-style bg='#9a6062',fg='#ece1d7'
set -g window-status-style bg='#292522',fg='#ece1d7'
set -g window-status-activity-style bg='#d47766',fg='#101010'
set -g window-status-bell-style bg='#d47766',fg='#101010'
# ## Pane number display
set-option -g display-panes-active-colour '#78997a'
set-option -g display-panes-colour '#c1a78e'
set -g pane-active-border-style "bg=#292522 fg=#78997a"
# set-option -g default-terminal "screen-256color" # this used to work, keeping it here for reference
# set-option -g default-terminal "tmux-256color" # this might only work in newer tmux.
# set-option -g default-terminal "xterm-256color"
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
set-option -g status-position bottom
# vi keys in copy mode
set -g mode-keys vi
# mouse select
# setw -g mode-mouse on
# set-option -g mouse-select-pane on
set-option -g renumber-windows on
set-window-option -g status-left "#(~/.dotfiles/tmux/status_left.sh)"
set-window-option -g status-right "#(~/.dotfiles/tmux/status_right.sh)"
set-window-option -g status-left-length 30
set-window-option -g status-right-length 100
set-window-option -g status-interval 60