-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
94 lines (71 loc) · 2.7 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
# vim: fdm=marker
# improve colors
set -g default-terminal 'screen-256color'
# act like GNU screen
unbind C-b
set -g prefix C-a
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# increase scrollback lines
set -g history-limit 10000
# sane splits
bind-key h split-window -v -c '#{pane_current_path}'
bind-key v split-window -h -c '#{pane_current_path}'
bind-key c new-window -c '#{pane_current_path}'
bind-key k confirm kill-window
#Allow mouse usage
set -g mouse on
# act like vim
setw -g mode-keys vi
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# switch to last pane
bind-key C-a last-pane
bind-key C-n next-window
bind-key C-p previous-window
# Shift + arrows to resize pane
bind -r S-Left resize-pane -L 2
bind -r S-Right resize-pane -R 2
bind -r S-Down resize-pane -D 1
bind -r S-Up resize-pane -U 1
# 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"
# Update default binding of `Enter` to use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe "xclip -i -selection clipboard"
unbind -T copy-mode-vi MouseDragEnd1Pane
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "xclip -i -selection clipboard"
# {{{ Status Bar
set -g status on
# soften status bar colors
set -g status-bg '#586e75'
set -g status-fg '#eee8d5'
# remove administrative debris (session name, hostname, time) in status bar
#set -g status-left ''
#set -g status-right ''
set -g status-left '#[bg=colour236,fg=colour246] [#[fg=colour231]#S#[fg=colour246]] #[default]'
set -g status-right " %H:%M %d-%b-%y "
setw -g window-status-separator ""
setw -g window-status-format " #I:#{?window_flags,#{window_flags},}#W "
setw -g window-status-current-format " #I:#{?window_flags,#{window_flags},}#W "
# setw -g window-status-current-bg colour236
# setw -g window-status-current-fg colour156
# setw -g window-status-current-attr bright
set -g status-justify centre
set-option -g status-left-length 50
# }}}
set -g status-keys emacs
setw -g clock-mode-style 12
# {{{
# https://github.com/tmux-plugins/tmux-prefix-highlight
# https://github.com/edkolev/tmuxline.vim
# https://github.com/christoomey/vim-tmux-navigator
# }}}