-
Notifications
You must be signed in to change notification settings - Fork 6
/
.tmux.conf
117 lines (94 loc) · 3.1 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# _tmux.conf
#
# Tmux configuration of Champions
#
# By: Jeremy Mack
# Found: On the internet
# Cobbled: Together
# ------------------------
# Bindings
# ------------------------
# Make sure we're running with 256 colors
set -g default-terminal "screen-256color"
# Make tmux menu activation key C-q
unbind C-b
set -g prefix M-e
set -g mouse on
# Reload tmux.conf on the fly
unbind r
bind r source-file ~/.tmux.conf
# Use VI Bindings in Copy Mode
set-window-option -g mode-keys vi
# Switch to specific pane
bind -n M-1 select-pane -t 0
bind -n M-2 select-pane -t 1
bind -n M-3 select-pane -t 2
bind -n M-4 select-pane -t 3
# -------------------------------------------------------
# Smart pane switching with awareness of vim splits
# from: 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"
# Resize panes with arrow keys
bind-key -nr M-Up resize-pane -U
bind-key -nr M-Down resize-pane -D
bind-key -nr M-Left resize-pane -L
bind-key -nr M-Right resize-pane -R
bind-key -nr M-h resize-pane -L
bind-key -nr M-j resize-pane -D
bind-key -nr M-k resize-pane -U
bind-key -nr M-l resize-pane -R
# Zoom pane to full screen
bind-key -nr M-z resize-pane -Z
# Horizontal and vertical pane splits
bind -n M-\ split-window -h
bind -n M-- split-window -v
# Copy and Paste Mode
bind-key -n M-v copy-mode
bind-key -n M-i paste-buffer
# -------------
# Vim Copy Mode
# from: http://cl.ly/0e2U2v062D3d
# -------------
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
bind-key -t vi-copy 'C-v' rectangle-toggle
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "xclip"
# Next / Previous Window
bind -n M-n next-window
bind -n M-p previous-window
# Equal Horizontal / Vertical Panes
bind -n M-= select-layout main-horizontal
bind -n M-+ select-layout even-vertical
# ---------------
# Change Sessions
# ---------------
# List
bind -n M-8 choose-session
# Previous
bind -n M-9 switch-client -p
# Next
bind -n M-0 switch-client -n
# No More Accidental Pane Killing
bind ^x kill-pane
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Put this at the bottom of .tmux.conf:
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'seebi/tmux-colors-solarized'
set -g @colors-solarized 'dark'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'