-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.tmux.conf
More file actions
103 lines (82 loc) · 2.69 KB
/
.tmux.conf
File metadata and controls
103 lines (82 loc) · 2.69 KB
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
##############################
# Michael's tmux.conf
##############################
# Reset prefix to C-o
unbind C-b
set -g prefix C-o
bind C-o send-prefix
set-option -g mouse on
set -g history-limit 50000
set-option repeat-time 400
set-option -g renumber-windows on
set -s escape-time 0
###################
# Aesthetics
###################
# Highlight active window
set-window-option -g window-status-current-bg yellow
set-window-option -g window-status-current-fg white
# Bottom bar, from http://www.drbunsen.org/the-text-triumvirate/
set -g status-left-length 52
set -g status-right-length 451
set -g status-fg white
set -g status-bg colour234
set -g window-status-activity-attr bold
set -g pane-border-fg colour245
set -g pane-active-border-fg colour39
set -g message-fg colour16
set -g message-bg colour221
set -g message-attr bold
###############
# Motion
###############
# Switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
bind-key k kill-window
##############
# Vim
##############
# Set vim movement keys hjkl, ctrl+D and ctrl+U for page down and up, and / search
set -g mode-keys vi
set -g status-keys vi
###################
# Copy/Paste
###################
# Copy to tmux buffer with vim-esque commands
bind [ copy-mode
unbind p
bind p paste-buffer
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-selection
bind-key -T copy-mode-vi 'Space' send -X halfpage-down
bind-key -T copy-mode-vi 'Bspace' send -X halfpage-up
# Preventing tmux yank from putting stray characters on screen
# https://github.com/tmux/tmux/issues/97
set -s set-clipboard off
##########################
# Pane Management
##########################
# Resizing panes
bind J resize-pane -D 5
bind K resize-pane -U 5
bind H resize-pane -L 5
bind L resize-pane -R 5
# Open new panes in same directory (only necessary for versions >= 1.9)
# https://unix.stackexchange.com/questions/12032/create-new-window-with-current-directory-in-tmux
if-shell '[ $(echo "$(tmux -V | cut -d" " -f2) >= 1.9" | bc) -eq 1 ]' \
'bind c new-window -c "#{pane_current_path}"'
# Rebind split window commands to prefix + | and prefix + -
# If version >= 1.9, need to specify to open in same directory
if-shell '[ $(echo "$(tmux -V | cut -d" " -f2) >= 1.9" | bc) -eq 1 ]' \
'bind | split-window -h -c "#{pane_current_path}"; bind - split-window -c "#{pane_current_path}"' \
'bind | split-window -h; bind - split-window -v'
# Stop renaming my windows!
set-option -g allow-rename off
unbind '"'
unbind %