-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathtmux.conf
128 lines (100 loc) · 4.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
#----------------------------------
#
# General settings
#
#----------------------------------
run 'tmux set -g default-shell "$(which fish)"'
# Setup vi mode
setw -g mode-keys vi
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'V' send -X select-line
bind-key -Tcopy-mode-vi 'r' send -X rectangle-toggle
bind-key -Tcopy-mode-vi Escape send -X cancel
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
#bind y run-shell "reattach-to-user-namespace -l zsh -c 'tmux show-buffer | pbcopy'"
bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g default-terminal "screen-256color"
# Use ctrl-a as prefix
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# UTF is great, let us use that
set -gq utf8
set-window-option -gq utf8 on
# command delay? We don't want that, make it short
set -sg escape-time 1
# Set the numbering of windows to go from 0
set-option -g base-index 0
setw -g pane-base-index 0
# Use xterm keys
set-window-option -g xterm-keys on
# Enable focus events option for neovim
set-option -g focus-events on
# Enable mouse gestures for e.g. pane resizing
set -g mouse on
#----------------------------------
#
# Visual settings
#
#----------------------------------
# Status bar positioning
set-option -g status-position top
set -g status-justify centre
set -g status-bg colour235
set -g status-fg white
set -g window-status-format ' #I:#W#F '
set -g window-status-current-format ' #I:#W '
set-window-option -g mode-style bg=colour36,fg=black,dim
set-window-option -g window-status-style bg=colour235,fg=colour244
set-window-option -g window-status-current-style bg=colour235,fg=white
left_sep_main="\uE0B0" # /!\ you don't need to install Powerline
left_sep_sub="\uE0B1" # you only need fonts patched with
right_sep_main="\uE0B2" # Powerline symbols or the standalone
right_sep_sub="\uE0B3" # PowerlineSymbols.otf font, see README.md
time_cet="#(TZ=Europe/Stockholm date +%%H):#(TZ=Europe/Stockholm date +%%M):%S"
time_lon="#(TZ=Europe/London date +%%H):#(TZ=Europe/London date +%%M)"
time_nyc="#(TZ=America/New_York date +%%H):#(TZ=America/New_York date +%%M)"
time_la="#(TZ=America/Los_Angeles date +%%H):#(TZ=America/Los_Angeles date +%%M)"
time_utc="#(TZ=UTC date +%%H):#(TZ=UTC date +%%M)"
set -g status-interval 1 # reload every 1s
set -g status-left "#[bg=colour36]#[fg=colour0] #S #[bg=colour235,fg=colour36]$left_sep_main"
set -g status-right "#[fg=colour236]$right_sep_main#[bg=colour236,fg=colour250] $time_cet CET#[fg=colour238] $right_sep_sub #[fg=colour250]$time_lon LON#[fg=colour238] $right_sep_sub #[fg=colour250]$time_nyc NYC#[fg=colour238] $right_sep_sub #[fg=colour250]$time_la PT#[fg=colour238] $right_sep_sub #[fg=colour250]$time_utc UTC#[fg=colour238] $right_sep_sub #[fg=colour250]%Y-%m-%d#[fg=colour244] "
set -g status-left-length 60
set -g status-right-length 164
set-option -g message-style bg=colour235,fg=colour166
set-option -g pane-border-style fg=colour36
set-option -g pane-active-border-style fg=colour36
# Allow us to reload our tmux configuration while using tmux.
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Getting interesting now, we use the vertical and horizontal symbols to split
# the screen
bind | split-window -h
bind - split-window -v
# Swapping of panes
bind < swap-pane -U
bind > swap-pane -D
# Killing windows and panes
bind w kill-pane
bind q kill-window
# Override the default behavior of showing a window preview
bind s choose-session -N
#----------------------------------
# Vim integration
#----------------------------------
# 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 -n 'C-\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
#---------------------------------
# tmux plugins
#---------------------------------
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-urlview'
# Run the plugin manager, should be the last line of the tmux.conf
run -b '~/.tmux/plugins/tpm/tpm'