-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
92 lines (76 loc) · 3.21 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
###
## Important! The tmux prefix is ctrl+space
###
unbind C-b
set -g prefix C-Space
bind Space send-prefix
set-option -g mouse on
set -g default-shell /usr/local/bin/zsh
set-option -g default-command "reattach-to-user-namespace -l zsh"
setw -g monitor-activity on
# ensure vi mode buffer navigation
set -g mode-keys vi
## Set up split commands (control v, control s)
bind-key 'a' new-window
bind-key v split-window -h -c "#{pane_current_path}"
bind-key s split-window -v -c "#{pane_current_path}"
# Smart pane switching with awareness of vim splits
# This requires a vim or tmux plugin
# See: https://github.com/christoomey/vim-tmux-navigator
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"
bind -r C-h resize-pane -L 5
bind -r C-j resize-pane -D 5
bind -r C-k resize-pane -U 5
bind -r C-l resize-pane -R 5
# rebind clear screen to `<prefix> C-l`
# bind C-l send-keys 'C-l'
# use `<PREFIX> Space` for copy-mode instead of default
unbind [
bind-key Space copy-mode
bind-key C-Space copy-mode
# Copy/Paste - skipping for now....
#unbind c-p
bind-key c-p paste-buffer
# Setup 'v' to begin selection as in Vim
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -Tcopy-mode-vi Enter
bind-key -Tcopy-mode-vi Enter send -X copy-pipe "reattach-to-user-namespace pbcopy"
# <prefix> + ctrl-x
bind C-x setw synchronize-panes
# Configure the look and feel
set -g default-terminal "screen-256color"
set-option -g set-titles on
set-option -g set-titles-string "###S.#I.#P #W (#H)"
set -g base-index 1
set -g pane-base-index 1
set -s escape-time 0
setw -g aggressive-resize on
set -g renumber-windows on
set -g pane-border-style fg=colour23,bg=black
set -g pane-active-border-style fg=colour2,bg=black
set -g message-style fg=colour16,bg=colour221,bold
set -g status-style fg=colour7,bg=colour8,bold
set -g window-status-activity-style fg=white,bold
set -g window-status-current-style fg=colour234,bg=colour46,bold
setw -g window-status-bell-style fg=colour7,bg=red,bold
set -g status-left ' #S '
set-option -g status-right '@#h #(date +"%B %d %Y %r")'
setw -g window-status-current-format ' #{?pane_synchronized,#[bg=red],}#I #W #F '
setw -g window-status-format ' #{?pane_synchronized,#[bg=red],}#I #W #F '
## Prevent tmux from displaying standout attr as italics. See
## http://www.mail-archive.com/[email protected]/msg01922.html
## and http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/2347
set -g terminal-overrides "rxvt-unicode*:sitm@,ritm@"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'