-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
executable file
·134 lines (101 loc) · 4.45 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
##############################
# => Plugin
##############################
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-pain-control'
# colors of terminal
#set -g default-terminal "screen-256color"
set -g default-terminal "xterm"
set -g terminal-overrides ',xterm-256color:Tc'
# Start numbering at 1
set -g base-index 1
set -g pane-base-index 1
# history
set -g history-limit 20000
# default-shell
set-option -g default-shell /bin/zsh
# remap prefix from 'C-b' to 'C-a', because Vim uses it
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# resize
bind -r H resize-pane -L 10
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 10
bind h select-pane -L
bind k select-pane -U
bind l select-pane -R
bind j select-pane -D
# smart pane switching with awareness of vim splits
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"
# reload config
bind r source ~/.tmux.conf
# splits
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# mouse
setw -g mouse on
##############################
# => tmux-resurrect
##############################
# for vim
set -g @resurrect-strategy-vim 'session'
# for neovim
set -g @resurrect-strategy-nvim 'session'
##############################
# => Style
##############################
# from https://github.com/egel/tmux-gruvbox
## COLORSCHEME: gruvbox dark
set-option -g status "on"
# default statusbar colors
set-option -g status-bg colour237 #bg1
set-option -g status-fg colour223 #fg1
# default window title colors
set-window-option -g window-status-bg colour250 #grey
set-window-option -g window-status-fg colour237 #bg1
set-window-option -g window-status-activity-bg colour237 #bg1
set-window-option -g window-status-activity-fg colour248 #fg3
# active window title colors
set-window-option -g window-status-current-bg default
set-window-option -g window-status-current-fg colour237 #bg1
# pane border
set-option -g pane-active-border-fg colour250 #fg2
set-option -g pane-border-fg colour237 #bg1
# message infos
set-option -g message-bg colour239 #bg2
set-option -g message-fg colour223 #fg1
# writting commands inactive
set-option -g message-command-bg colour239 #fg3
set-option -g message-command-fg colour223 #bg1
# pane number display
set-option -g display-panes-active-colour colour250 #fg2
set-option -g display-panes-colour colour237 #bg1
# clock
set-window-option -g clock-mode-colour colour109 #blue
# bell
set-window-option -g window-status-bell-style fg=colour235,bg=colour167 #bg, red
## Theme settings mixed with colors (unfortunately, but there is no cleaner way)
set-option -g status-attr "none"
set-option -g status-justify "left"
set-option -g status-left-attr "none"
set-option -g status-left-length "80"
set-option -g status-right-attr "none"
set-option -g status-right-length "80"
set-window-option -g window-status-activity-attr "none"
set-window-option -g window-status-attr "none"
set-window-option -g window-status-separator ""
set-option -g status-left ""
set-option -g status-right "#[fg=colour239, bg=colour237, nobold, nounderscore, noitalics]#[fg=colour246,bg=colour239] %Y-%m-%d %H:%M #[fg=colour248, bg=colour239, nobold, noitalics, nounderscore]#[fg=colour237, bg=colour248] #h "
set-window-option -g window-status-current-format "#[fg=colour239, bg=colour248, :nobold, noitalics, nounderscore]#[fg=colour239, bg=colour250] #I #[fg=colour239, bg=colour250, bold] #W #[fg=colour250, bg=colour237, nobold, noitalics, nounderscore]"
set-window-option -g window-status-format "#[fg=colour237,bg=colour239,noitalics]#[fg=colour223,bg=colour239] #I #[fg=colour223, bg=colour239] #W #[fg=colour239, bg=colour237, noitalics]"
run '~/.tmux/plugins/tpm/tpm'