-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
144 lines (129 loc) · 4.57 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
######
# prefix
######
unbind C-b
set-option -g prefix M-a
bind-key M-a send-prefix
######
# settings
######
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
# make term emul title show tmux pane title
set -g set-titles on
set -g set-titles-string "#W/#T"
# mouse
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
# To copy, left click and drag to highlight text in yellow,
# once you release left click yellow text will disappear and will automatically be available in clibboard
# # Use vim keybindings in copy mode
setw -g mode-keys vi
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
# misc
set-option -g history-limit 5000
# renumber windows when one is killed
set-option -g renumber-windows on
set-option -g default-shell /bin/zsh
######
# keybinding
######
# sessions
bind 1 "run-shell 'tmux switch -t 0 || tmux new -s 0 -d; tmux switch -t 0'"
bind 2 "run-shell 'tmux switch -t 1 || tmux new -s 1 -d; tmux switch -t 1'"
bind 3 "run-shell 'tmux switch -t 2 || tmux new -s 2 -d; tmux switch -t 2'"
bind 4 "run-shell 'tmux switch -t 3 || tmux new -s 3 -d; tmux switch -t 3'"
bind 5 "run-shell 'tmux switch -t 4 || tmux new -s 4 -d; tmux switch -t 4'"
# windows
# new
bind -n M-t new-window -c "#{pane_current_path}"
#move
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
bind -n M-5 select-window -t 10
#swap
bind -n C-M-h swap-pane -s '{left-of}'
bind -n C-M-j swap-pane -s '{down-of}'
bind -n C-M-k swap-pane -s '{up-of}'
bind -n C-M-l swap-pane -s '{right-of}'
# panes
# open
bind -n M-x split-window -v -c "#{pane_current_path}"
bind -n C-M-x split-window -fv -c "#{pane_current_path}"
bind -n M-v split-window -h -c "#{pane_current_path}"
bind -n C-M-v split-window -fh -c "#{pane_current_path}"
# move
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# resize
bind -r M-h resize-pane -L
bind -r M-j resize-pane -D
bind -r M-k resize-pane -U
bind -r M-l resize-pane -R
bind -r M-H resize-pane -L 5
bind -r M-J resize-pane -D 5
bind -r M-K resize-pane -U 5
bind -r M-L resize-pane -R 5
# other
bind -n M-z resize-pane -Z # toggle full-screen for the current pane
bind-key -n Home send Escape "OH"
bind-key -n End send Escape "OF"
# ######
# # display
# deprecated by dracula plugin
# ######
#
# # panes - border around them
# set -g pane-border-style 'bg=colour0 fg=colour4'
# set -g pane-active-border-style 'bg=colour0 fg=colour10'
#
# # statusbar
# set -g status-position bottom
# set -g status-justify left
# # base window style
# set -g status-style 'bg=colour8 fg=colour4 dim'
# set -g status-left ''
# # status section on right
# set -g status-right '#[fg=colour233,bg=colour3] %d/%m #[fg=colour233,bg=colour5] %H:%M:%S '
# set -g status-right-length 50
# set -g status-left-length 20
#
# # active window
# setw -g window-status-current-style 'fg=colour4 bg=colour16 bold'
# setw -g window-status-current-format ' #I#[fg=colour4]:#[fg=colour4]#W#[fg=colour10]#F '
#
# setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'
# display vim correctly
set -s escape-time 0
set -g default-terminal "xterm-kitty"
set -ga terminal-overrides ",*256col*:Tc"
# plugin list
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'dracula/tmux'
# plugin config
set -g @dracula-show-powerline true
set -g @dracula-plugins "cpu-usage ram-usage battery"
set -g @dracula-cpu-usage-label "CPU"
set -g @dracula-ram-usage-label "RAM"
set -g @dracula-show-location false
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'