-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_tmux.conf
79 lines (58 loc) · 2.73 KB
/
dot_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
set -g mouse on # damn useful for scrolling through logs
set -g default-terminal "xterm-256color"
# make colors inside tmux look the same as outside of tmux
# see https://github.com/tmux/tmux/issues/696
# see https://stackoverflow.com/a/41786092
set-option -ga terminal-overrides ",xterm-256color:Tc"
set-option -g set-titles off
set-option -g prefix C-b
bind C-b send-prefix
# Vim style navigation.
bind k select-pane -U
bind j select-pane -D
bind h select-pane -L
bind l select-pane -R
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(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"
bind left resize-pane -L 20
bind right resize-pane -R 20
bind up resize-pane -U 5
bind down resize-pane -D 5
setw -g mode-keys vi
setw -g xterm-keys on # to make ctrl-arrow, etc. work
bind Escape copy-mode
bind-key -T edit-mode-vi Up send-keys -X history-up
bind-key -T edit-mode-vi Down send-keys -X history-down
unbind-key -T copy-mode-vi Space ; bind-key -T copy-mode-vi v send-keys -X begin-selection
unbind-key -T copy-mode-vi Enter ; bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
unbind-key -T copy-mode-vi C-v ; bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
unbind-key -T copy-mode-vi [ ; bind-key -T copy-mode-vi [ send-keys -X begin-selection
unbind-key -T copy-mode-vi ] ; bind-key -T copy-mode-vi ] send-keys -X copy-selection
## Reduce command delay so more responsive
set -sg escape-time 0
## Set windows and panes so they start at 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1
## Reload config file with Prefix -
bind r source-file ~/.tmux.conf \; display "Reloaded!"
set -g status-style fg=white,bg=default
set -g message-style fg=white,bg=black,bright
setw -g window-status-style fg=cyan,bg=default,dim
setw -g window-status-current-style fg=black,bg=cyan,dim
## Status line left side
set -g status-left-length 40
set -g status-left "#[fg=green]#S "
## Status line right side # hostname | 28 Nov 18:15
set -g status-right "#[fg=red]#h #[fg=yellow]%d %b %R"
## Update the status bar every fifteen seconds
set -g status-interval 15
set-option -g history-limit 100000
set-option -g focus-events on
## Allows attaching to same session without resizing original (tmux new-session -t '{session_name}')
setw -g aggressive-resize on