-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
144 lines (123 loc) · 4.24 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
## GENERAL OPTIONS
# use 256 colors and correct italic/standout mode
# set -g default-terminal "screen-256color"
# set -g default-terminal "xterm-256color"
set -g default-terminal "tmux-256color"
# set -ga terminal-overrides ',screen-256color:Tc'
# set -ga terminal-overrides ',xterm-256color:Tc'
set -ag terminal-overrides ",xterm-256color:RGB"
# don't spawn login shell
set -g default-command fish
# setw -g xterm-keys
# increase scrollback buffer size
set -g history-limit 10000
# don't wait for escape sequence - fixes vim
set -sg escape-time 0
# Mouse can be handy
setw -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
# setw -g mode-mouse on
# set -g mouse-select-pane on
# set -g mouse-resize-pane on
# set -g mouse-select-window on
# statusline options
setw -g monitor-activity on
set -g status-interval 5
set -g display-time 2000
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
## APPEARANCE
# statusbar
set -g status-bg colour0
set -g status-fg colour7
set -g status-left-length 30
set -g status-left '#[fg=colour6]#(whoami)@#(hostname) '
# set -g status-right '#[fg=colour1]%a-%d-%b %R'
set -g status-right '%a-%d-%b %R'
# window title colors and apperance
setw -g window-status-current-fg colour0
setw -g window-status-current-bg colour7
setw -g window-status-activity-attr underscore
setw -g window-status-format " #I:#W "
setw -g window-status-current-format " #I:#W "
setw -g window-status-separator ''
# pane border
set -g pane-active-border-fg colour11
set -g pane-border-fg colour8
# terminl title
set -g set-titles on
set -g set-titles-string '#S:#I #W'
# messages
# set -g message-style bg=default,fg=colour5
set -g message-bg colour0
set -g message-fg colour7
## BINDINGS
# change default prefix key
set -g prefix C-a
unbind-key C-b
bind C-a send-prefix
bind-key a last-window
# reload config
bind r source-file ~/.tmux.conf\; display-message "Config reloaded..."
# y and v as in vim
# bind -t vi-copy 'v' begin-selection
bind-key -T copy-mode-vi 'v' send -X begin-selection
# bind -t vi-copy 'y' copy-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "xsel -ib"
# bind -t vi-copy 'Space' halfpage-down
bind-key -T copy-mode-vi 'Space' send -X halfpage-down
# bind -t vi-copy 'Bspace' halfpage-up
bind-key -T copy-mode-vi 'Bspace' send -X halfpage-up
# open new window in the same directory as current window
bind C new-window -c '#{pane_current_path}'
# easy to remember split pane commands
# make sure split opens with the same directory as current pane
bind | split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
# moving and swapping
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key N swap-pane -D
bind-key P swap-pane -U
# resizing:
bind-key -r C-h resize-pane -L 5
bind-key -r C-j resize-pane -D 5
bind-key -r C-k resize-pane -U 5
bind-key -r C-l resize-pane -R 5
# change windows firefox-style
bind-key -n M-1 select-window -t :1
bind-key -n M-2 select-window -t :2
bind-key -n M-3 select-window -t :3
bind-key -n M-4 select-window -t :4
bind-key -n M-5 select-window -t :5
bind-key -n M-6 select-window -t :6
bind-key -n M-7 select-window -t :7
bind-key -n M-8 select-window -t :8
bind-key -n M-9 select-window -t :9
bind-key -n M-0 select-window -t :10
# # Smart pane switching with awareness of vim splits
# is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
# bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
# bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
# bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
# bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# # restore clear screen
# bind C-l send-keys 'C-l'
## PLUGINS
# List of plugins
# set -g @tpm_plugins ' \
# tmux-plugins/tpm \
# tmux-plugins/tmux-yank \
# tmux-plugins/tmux-copycat \
# tmux-plugins/tmux-urlview \
# tmux-plugins/tmux-resurrect \
# tmux-plugins/tmux-continuum \
# tmux-plugins/tmux-open \
# '
#
# # Initializes TMUX plugin manager
# run-shell '~/.tmux/plugins/tpm/tpm'