-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
72 lines (54 loc) · 2.68 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
# Set ctrl-s as prefix key
unbind C-b
set -g prefix C-s
# Reload tmux.conf with prefix-r
bind-key r source-file ~/.tmux.conf\; display-message "~/.tmux.conf reloaded"
# Smart pane switching with awareness of Vim splits.
# # See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n 'C-\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Use emacs / readline key-bindings at the tmux command prompt `<prefix>:`
set-option -g status-keys "emacs"
set-option -g default-terminal "tmux-256color"
# Status bar display settings
set-option -g status-left-length 50
set-option -g status-right "#(date '+%a, %b %d - %I:%M')"
# Enable vi-like bindings and use xclip to enable copy from tmux to clipboard
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -sel clip-i'
# More intuitive keys for splitting panes
bind-key - split-window -v
bind-key '\' split-window -h
# New window
bind-key c new-window -c "#{pane_current_path}"
# Panes resize keys
bind-key -n S-Left resize-pane -L 2 # Shift and the arrow keys enable
bind-key -n S-Right resize-pane -R 2 # fine adjustment (1 or 2 cursor
bind-key -n S-Down resize-pane -D 2 # cells per bump)
bind-key -n S-Up resize-pane -U 2
bind-key -n C-Left resize-pane -L 10 # Control and the arrow keys enable
bind-key -n C-Right resize-pane -R 10 # coarse adjustment (5 or 10 cursor
bind-key -n C-Down resize-pane -D 5 # cells per bump)
bind-key -n C-Up resize-pane -U 5
# Make the window numbering mode logical and intuitive
set -g base-index 1 # Star numbering at 1 (default => 0)
set -g renumber-windows on # Keep window numbers consistent
bind-key b break-pane -d # Send current pane to background window
# Prompted join-pane
bind-key j command-prompt -p "join pane from:" "join-pane -h -s '%%'"
# Easily swap a pane (targeted by pane number) with the current pane
bind-key s display-panes\; command-prompt -p "target pane #:" "swap-pane -t '%%'"
bind-key C-j choose-tree # Display a selectable list of sessions
# Plugins
set -g @plugin 'schasse/tmux-jump'
set -g @plugin 'seebi/tmux-colors-solarized'
# Solarized theme
set -g @colors-solarized 'dark'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'