-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
127 lines (94 loc) · 3.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
# _
# | |
# | |_ _ __ ___ _ ___ ___ __ ___
# | __| '_ ` _ \| | | \ \/ / '__/ __|
# | |_| | | | | | |_| |> <| | | (__
# \__|_| |_| |_|\__,_/_/\_\_| \___|
# -- Key Bindings --------------------------------------------------------------
# Remap prefix from 'C-b' to 'C-a'
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# # Pane resizing w/ key repeat
bind -r H resize-pane -L
bind -r J resize-pane -D
bind -r K resize-pane -U
bind -r L resize-pane -R
# Vertical(v) and Horizontal(h) pane splitting
bind | split-window -h
bind - split-window -v
# Reload config file
bind r source-file ~/.tmux.conf \; display-message 'Config reloaded...'
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
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 -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
# -- Unbind --------------------------------------------------------------------
unbind '"' # vertical split
unbind '%' # horizontal split
unbind 'h'
unbind 'j'
unbind 'k'
unbind 'l'
# -- Appearance ----------------------------------------------------------------
# TURN ON/OFF STATUS BAR
# set -g status on
# set -g status-position bottom
# I think set = set-option
# I think setw = set-window-option
### color
# enable 256 colors
# https://superuser.com/questions/285381/how-does-the-tmux-color-palette-work/1104214#1104214
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
# useful for converting from 256 to hex
# https://jonasjacek.github.io/colors/
# cool colors
# orange -> colour202
# yellow -> colour226
# purple -> colour200
# pink -> colour198
# status bar
set -g status-style fg=white,bg=black
# default window color, attr
setw -g window-status-style fg=default,bg=default
# current window color, attr
setw -g window-status-current-style fg=colour10,bg=default
# default pane border
set -g pane-border-style fg=white,bg=colour235
# active pane border
set -g pane-active-border-style fg=white,bg=colour235
# message text
set -g message-style fg=white,bg=black
### content
# status bar order
set -g status-left '[ #S ]' # session name
set -g status-right '' # blank
# because the window name was getting cut off
set -g status-left-length 30
# center status bar
set -g status-justify 'centre' # left, centre, right
# spacing in between window names
set -g window-status-separator ' \ '
# remove numbers (#I) and '*' (#F) on status bar
setw -g window-status-current-format '#W'
setw -g window-status-format '#W'
# you can't change pane seperator width. It will always be one char tall and one char
# wide because it doesn't have access to something idk.
# -- Other --------------------------------------------------------------------
# Enable mouse mode
set -g mouse on
# don't rename windows automatically
# this can also improve performance
setw -g automatic-rename off
set -g allow-rename off
# Supposedly fixes lag when switching out of insert mode
set -sg escape-time 0