-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.tmux.conf
138 lines (101 loc) · 4.83 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
set-option -g history-limit 100000
# Modern colors
if-shell 'uname | grep -q Darwin' 'set -g default-terminal "xterm-256color"'
if-shell 'uname | grep -q Linux' 'set -g default-terminal "tmux-256color"'
set-option -sa terminal-overrides ",*256col*:Tc"
# Unbind the prefix and bind it to Ctrl-a like screen
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Use screen shortcut (prefix a) for toggling windows
unbind -T prefix l
bind-key -T prefix a last-window
# VIM mode
set -g mode-keys vi
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'xsel -ib'
bind-key -T copy-mode-vi Escape send -X cancel
bind-key -T copy-mode-vi C-v send -X rectangle-toggle
set -s copy-command 'xsel -ib'
# Copy complete pane content to clipboard
bind-key -T prefix y run "tmux capture-pane -pS-|xsel -ib"
# Make middle-mouse-click paste from the primary selection (without having to hold down Shift).
bind-key -n MouseDown2Pane run "tmux set-buffer -b primary_selection \"$(xsel -ob)\"; tmux paste-buffer -b primary_selection; tmux delete-buffer -b primary_selection"
# Keep tmux in copy mode after releasing mouse button
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear pbcopy
bind-key -T prefix Enter copy-mode \; send-keys Up
bind-key -T prefix p paste-buffer
# Quick switch between windows
bind-key -T root C-PageDown next-window
bind-key -T root C-PageUp previous-window
# Swap windows
bind-key -n C-S-PageUp swap-window -d -t -1
bind-key -n C-S-PageDown swap-window -d -t +1
# Splitting panes
unbind -T prefix '"'
bind-key -T prefix | split-window -h
unbind -T prefix &
bind-key -T prefix - split-window -v
# Reload config file (change file location to your the tmux.conf you want to use)
bind -T prefix r source-file ~/.tmux.conf
# Mouse friendly
set -g mouse on
# System clipboard
set -g set-clipboard off
# Use current directory as window title but allow manual renaming
set-option -g allow-rename off
set-option -g automatic-rename-format '#{b:pane_current_path}'
# Monitoring
setw -g monitor-activity on
set -g visual-activity off
setw -g monitor-silence 0
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# Automatically renumber windows when one is deleted
set-option -g renumber-windows on
# Default shell
if-shell 'uname | grep -q Darwin' 'set-option -g default-shell /bin/zsh'
if-shell 'uname | grep -q Linux' 'set-option -g default-shell /usr/bin/fish'
# Disable right-click menu in tmux 3.0
unbind-key -T root MouseDown3Pane
# Address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0
# tmux messages are displayed for 4 seconds
set -g display-time 4000
# Emacs key bindings in tmux command prompt (prefix + :) are better than vi keys, even for vim users
set -g status-keys emacs
# Focus events enabled for terminals that support them
set -g focus-events on
# Move statusbar to the top
set-option -g status "on"
set-option -g status-position top
######################
### Color scheme
######################
# iceberg colors
COL_FG="#c6c8d1"
COL_BG_MEDIUM="#4c566a"
COL_BG_DARK="#3b4252"
COL_BG_VERY_DARK="#2e3440"
set -g status-left-style "none"
set -g message-command-style "fg=$COL_FG,bg=$COL_BG_DARK"
set -g status-right-style "none"
set -g status-style "none,bg=$COL_BG_VERY_DARK"
set -g message-style "fg=$COL_FG,bg=$COL_BG_DARK"
set -g pane-active-border-style "fg=$COL_BG_DARK bg=$COL_BG_DARK"
set -g pane-border-style "fg=$COL_BG_DARK bg=$COL_BG_DARK"
set-option -g status-style "none,fg=$COL_FG,bg=$COL_BG_VERY_DARK"
set-option -g status-justify "centre"
# window-status-activity-attr is reverse by default, which means bg and fg are switched
set-window-option -g window-status-activity-style none
set-window-option -g window-status-separator ''
set -g status-left "#[fg=$COL_FG,bg=$COL_BG_DARK] #S #[fg=$COL_BG_DARK,bg=$COL_BG_VERY_DARK] "
set -g status-right "#[fg=$COL_FG,bg=$COL_BG_VERY_DARK] #[fg=$COL_BG_DARK,bg=$COL_BG_VERY_DARK]#[fg=$COL_FG,bg=$COL_BG_DARK] %d.%m.%Y "
activity_color="#{?window_activity_flag,colour1,$COL_FG}"
status_color="#{?window_silence_flag,colour3,${activity_color}}"
set-window-option -g window-status-current-format "#[fg=$COL_BG_MEDIUM,bg=$COL_BG_VERY_DARK]#[fg=$COL_FG,bg=$COL_BG_MEDIUM] #{window_index} #{window_name} #[fg=$COL_BG_MEDIUM,bg=$COL_BG_VERY_DARK]"
set-window-option -g window-status-format "#[fg=$COL_BG_DARK,bg=$COL_BG_VERY_DARK]#[fg=${status_color},bg=$COL_BG_DARK] #{window_index} #{window_name} #[fg=$COL_BG_DARK,bg=$COL_BG_VERY_DARK]"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
run '~/.tmux/plugins/tpm/tpm'