-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
178 lines (152 loc) · 7.44 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#------------------------------------------------------------------------------#
# vi: set sw=4 ts=4 ai: ("set modeline" in ~/.exrc) #
#------------------------------------------------------------------------------#
# Config file : ~/.tmux.conf #
# #
# Original Author : Ton Kersten The Netherlands #
# Customized by : Omar Mekky (http://cousine.me) #
#------------------------------------------------------------------------------#
# I use all Alt-Keys instead of Ctrl. This because I use a lot of Ctrl in
# Vim and so on and I don't like to use the Prefix all the time.
# And.... this also works on OSX with iTerm2
#new-session -d -s "cousine"
set-environment -g INTMUX 1
set -g default-shell /usr/local/bin/zsh
# Add truecolor support
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Default terminal is 256 colors
set -g default-terminal "xterm-256color"
# COPY-PASTE
set -g default-command "reattach-to-user-namespace -l zsh"
# Vim keys
setw -g mode-keys vi
# Set that stupid Esc-Wait off, so VI works again
set-option -sg escape-time 0
# Set the prefix to Alt-A
set-option -g prefix M-a
bind-key M-a send-prefix
#set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
# Mouse
#set -g mode-mouse off
# All kind of nice options
set-option -g bell-action any
set-option -g display-panes-colour red
set-option -g history-limit 100000
set-option -g repeat-time 500
set-option -g visual-activity off
set-option -g visual-bell on
set-option -g set-titles on
set-option -g set-titles-string ' #I-#W '
set-option -g base-index 1
# Screen lock
bind-key C-x lock-server
bind-key x lock-server
bind-key -n M-x lock-server
set-option -g lock-after-time 0
#set-option -g lock-server on
set-option -g lock-command "vlock"
set-window-option -g window-status-attr dim
# Window options
set-window-option -g clock-mode-colour blue
set-window-option -g clock-mode-style 24
set-window-option -g monitor-activity on
set-window-option -g xterm-keys on
set-window-option -g automatic-rename on
set-window-option -g aggressive-resize off
# Remap keys to my settings
unbind-key M-d ; bind-key -n M-d detach-client
unbind-key d ; bind-key d detach-client
unbind-key M-c ; bind-key -n M-c command-prompt -p "tmux:"
unbind-key M-m ; bind-key -n M-m command-prompt -p "Man:" "split-window 'man %%'"
unbind-key Tab ; bind-key -n M-Tab choose-window
unbind-key M-e ; bind-key -n M-e choose-session
unbind-key M-t ; bind-key -n M-t new-window
unbind-key t ; bind-key t new-window
unbind-key M-` ; bind-key -n M-` last-window
unbind-key n ; bind-key n next-window
unbind-key p ; bind-key p previous-window
unbind-key M-n ; bind-key -n M-n next-window
unbind-key M-p ; bind-key -n M-p previous-window
unbind-key M-right ; bind-key M-right next-window
unbind-key M-left ; bind-key M-left previous-window
# Window selection
unbind-key 1 ; bind-key 1 select-window -t 1
unbind-key 2 ; bind-key 2 select-window -t 2
unbind-key 3 ; bind-key 3 select-window -t 3
unbind-key 4 ; bind-key 4 select-window -t 4
unbind-key 5 ; bind-key 5 select-window -t 5
unbind-key 6 ; bind-key 6 select-window -t 6
unbind-key 7 ; bind-key 7 select-window -t 7
unbind-key 8 ; bind-key 8 select-window -t 8
unbind-key 9 ; bind-key 9 select-window -t 9
unbind-key 0 ; bind-key 0 select-window -t 10
unbind-key M-1 ; bind-key -n M-1 select-window -t 1
unbind-key M-2 ; bind-key -n M-2 select-window -t 2
unbind-key M-3 ; bind-key -n M-3 select-window -t 3
unbind-key M-4 ; bind-key -n M-4 select-window -t 4
unbind-key M-5 ; bind-key -n M-5 select-window -t 5
unbind-key M-6 ; bind-key -n M-6 select-window -t 6
unbind-key M-7 ; bind-key -n M-7 select-window -t 7
unbind-key M-8 ; bind-key -n M-8 select-window -t 8
unbind-key M-9 ; bind-key -n M-9 select-window -t 9
unbind-key M-0 ; bind-key -n M-0 select-window -t 10
# Window splitting
unbind-key M-- ; bind-key -n M-- split-window -v -c '#{pane_current_path}'
unbind-key M-\ ; bind-key -n M-\ split-window -h -c '#{pane_current_path}'
unbind-key \ ; bind-key \ split-window -h -c '#{pane_current_path}'
unbind-key | ; bind-key | split-window -h -c '#{pane_current_path}'
unbind-key - ; bind-key - split-window -v -c '#{pane_current_path}'
unbind-key M-b ; bind-key -n M-b split-window -v -c '#{pane_current_path}' -p 10
# Pane selection and resizing
unbind-key left ; bind-key -n M-left select-pane -L
unbind-key up ; bind-key -n M-up select-pane -U
unbind-key down ; bind-key -n M-down select-pane -D
unbind-key right ; bind-key -n M-right select-pane -R
unbind-key j ; bind-key -r j resize-pane -D 5
unbind-key k ; bind-key -r k resize-pane -U 5
unbind-key h ; bind-key -r h resize-pane -L 5
unbind-key l ; bind-key -r l resize-pane -R 5
unbind-key x ; bind-key -n M-x confirm-before kill-pane
unbind-key z ; bind-key -n M-z resize-pane -Z
unbind-key M-j ; bind-key M-j command-prompt -p "join pane from:" "join-pane -s '%%'"
unbind-key M-k ; bind-key M-k command-prompt -p "send pane to:" "join-pane -t '%%'"
unbind-key M-r ; bind-key -n M-r source-file ~/.tmux.conf
unbind-key M-q ; bind-key -n M-q list-keys
# Copy mode
set-option buffer-limit 10
unbind-key M-NPage ; bind-key -n M-NPage copy-mode
unbind-key M-PPage ; bind-key -n M-PPage copy-mode
unbind-key M-i ; bind-key -n M-i paste-buffer
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
# 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 "reattach-to-user-namespace pbcopy"
# Sync
unbind-key M-s ; bind-key -n M-s setw synchronize-panes
# Onedark colors
onedark_black="#282c34"
onedark_blue="#61afef"
onedark_yellow="#e5c07b"
onedark_red="#e06c75"
onedark_white="#aab2bf"
onedark_green="#98c379"
onedark_visual_grey="#2c323c"
onedark_comment_grey="#5c6370"
# Power line
set-option -g status on
set-option -g status-interval 2
set-option -g status-justify "left"
set-option -g status-left-length 80
set-option -g status-right-length 90
set-option -g status-bg $onedark_visual_grey
set-window-option -g window-status-format "#[fg=$onedark_white, bg=$onedark_visual_grey] #I:#W"
set-window-option -g window-status-current-format "#[bg=$onedark_visual_grey] #[fg=$onedark_black,nobold, bg=$onedark_yellow][#I:#W]"
set-window-option -g window-status-activity-style "bg=$onedark_black, fg=$onedark_white"
set-option -g pane-border-fg $onedark_visual_grey
set-option -g pane-active-border-fg $onedark_green
set-option -g message-bg $onedark_red
# TODO: UPDATE THOSE PATHS TO YOUR DOTFILES DIR
set-option -g status-left "#(~/projects/dotfiles/cousine/tmux-powerline/powerline.sh left)"
set-option -g status-right "#(~/projects/dotfiles/cousine/tmux-powerline/powerline.sh right)"