-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
113 lines (88 loc) · 3.88 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
# GNU screen password bug on my mac. I can either custom code a work-around
# or switch to tmux. Tired of really dirty hacks to make screen do what I want,
# and what other things support as first class citizens.
#
# I'm sorry, screen, it's been really wonderful, but I need to take a
# break.
# I use esc lots for vim. By default, tmux holds on to esc characters
# for 500ms, which is _more_ than enough for me to hit esc three times,
# and then start typing commands a bunch...
#
# Tune this better if you use esc for tmux keymaps, I guess.
set -sg escape-time 10
# Make it feel more home-y
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Make splits what I expect them to be (my old screen keys)
bind | split-window -h -c "#{pane_current_path}"
bind S split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# Bonus: Make sure tmux mouse mode is on (not true by default in all
# OSes.)
set -g mouse on
# Use the ctrl+vim mode keys to navigate that I like.
# setw -g mode-keys vi
# bind-key -n 'C-h' select-pane -L
# bind-key 'C-h' send-keys 'C-h'
# bind-key -n 'C-j' select-pane -D
# bind-key 'C-j' send-keys 'C-j'
# bind-key -n 'C-k' select-pane -U
# bind-key 'C-k' send-keys 'C-k'
# bind-key -n 'C-l' select-pane -R
# bind-key 'C-l' send-keys 'C-l'
# bind-key -n 'C-\' select-pane -l
# Integrate with tmux
# https://github.com/aserowy/tmux.nvim
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?\.?(view|n?vim?x?)(-wrapped)?(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' { if -F '#{pane_at_left}' '' 'select-pane -L' }
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' { if -F '#{pane_at_bottom}' '' 'select-pane -D' }
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' { if -F '#{pane_at_top}' '' 'select-pane -U' }
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' { if -F '#{pane_at_right}' '' 'select-pane -R' }
bind-key -T copy-mode-vi 'C-h' if -F '#{pane_at_left}' '' 'select-pane -L'
bind-key -T copy-mode-vi 'C-j' if -F '#{pane_at_bottom}' '' 'select-pane -D'
bind-key -T copy-mode-vi 'C-k' if -F '#{pane_at_top}' '' 'select-pane -U'
bind-key -T copy-mode-vi 'C-l' if -F '#{pane_at_right}' '' 'select-pane -R'
# screen is a nice default shell; BUT I want my pretty colors.
# xterm-256color is pretty bog standard for this.
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
# make sure titles stay in sync
set-option -g set-titles on
set-option -g set-titles-string "#S / #T"
# Might as well set my shell
set-option -g default-shell /bin/bash
#### COLOUR (Solarized dark)
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-dark.conf
# -> https://github.com/altercation/solarized/commit/e40cd4130e2a82f9b03ada1ca378b7701b1a9110
# default statusbar colors
set-option -g status-style fg=yellow,bg=black #yellow and base02
# default window title colors
set-window-option -g window-status-style fg=brightblue,bg=default #base0 and default
#set-window-option -g window-status-style dim
# active window title colors
set-window-option -g window-status-current-style fg=brightred,bg=default #orange and default
#set-window-option -g window-status-current-style bright
# pane border
set-option -g pane-border-style fg=cyan
set-option -g pane-active-border-style fg=colour166
# message text
set-option -g message-style fg=brightred,bg=black #orange and base01
# pane number display
set-option -g display-panes-active-colour blue #blue
set-option -g display-panes-colour brightred #orange
# clock
set-window-option -g clock-mode-colour green #green
# bell
set-window-option -g window-status-bell-style fg=black,bg=red #base02, red
# reload config file
bind r source-file ~/.tmux.conf
# statusbar
set -g status-position bottom
set -g status-justify left
set -g status-style 'fg=colour1'
set -g status-right '%Y-%m-%d %H:%M '
set -g status-right-length 50
# set -g status-left ''
# set -g status-left-length 10