-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
75 lines (50 loc) · 2.14 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
# --- plugins ---
set -g @plugin 'tmux-plugins/tmux-resurrect'
# --- constrain to larger if no other users ---
set -g aggressive-resize on
# --- faster repeats ---
set-option -g repeat-time 0
# --- unset rbenv_version: ---
set-environment -gu RBENV_VERSION
# someone knows why this happens. see http://stackoverflow.com/questions/15002937/how-to-stop-making-tmux-auto-setting-rbenv-version/15021934
# --- system copy ---
set-option -g default-command "reattach-to-user-namespace -l zsh"
bind C-c run "tmux show-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# --- increase scrollback limit ---
set -g history-limit 999999999
# --- screen mode: ---
unbind ^A; bind ^A last-window
set -g prefix C-a
set -g base-index 1
setw -g pane-base-index 1
# --- use vim keys ---
set-window-option -g mode-keys vi
unbind ^T; bind ^T split-window -p 25
unbind Right; bind Right resize-pane -R 8
unbind Left; bind Left resize-pane -L 8
unbind Up; bind Up resize-pane -U 4
unbind Down; bind Down resize-pane -D 4
unbind h; bind h select-pane -L
unbind j; bind j select-pane -D
unbind k; bind k select-pane -U
unbind l; bind l select-pane -R
# --- tmux + vim navigation. ---
# --- depends on https://github.com/christoomey/vim-tmux-navigator ---
not_tmux="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?(g?(view|n?vim?x?)(diff)?|fzf)$'"
bind -n C-h if-shell "$not_tmux" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$not_tmux" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$not_tmux" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$not_tmux" "send-keys C-l" "select-pane -R"
bind -n 'C-\' if-shell "$not_tmux" "send-keys 'C-\\'" "select-pane -l"
bind C-l send-keys 'C-l'
# --- mouse mode ---
set-option -g mouse on
# gross: (https://github.com/tmux/tmux/issues/108)
set -g status-interval 0
source-file ~/.tmux/themes/powerline.conf
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'