-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
104 lines (81 loc) · 3.07 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
# use screen binding
#unbind C-b
set -g prefix C-a
bind a send-prefix
# increase buffer size
set -g history-limit 100000
# speed up input
set -s escape-time 0
# windows start at 1, not 0
set -g base-index 1
# panes start at 1, not 0
setw -g pane-base-index 1
# reload conf
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
# switch to last window
bind C-a last-window
# set split window bindings
bind | split-window -h
bind - split-window -v
# use the vim motion keys to move between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# set status bar
set -g status-bg black
set -g status-fg white
set -g status-right "#[fg=green]#H"
#set -g status-left ‘#[fg=green]#H’
#set -g status-right ‘#[fg=yellow]#(uptime | cut -d “,” -f 2-)’
# highlight active window
set-window-option -g window-status-current-style "bg=red"
# notifications
setw -g monitor-activity on
setw -g visual-activity on
# auto rename
set -g automatic-rename on
# renumber windows when a window is closed
set -g renumber-windows on
# default terminal
set -g default-terminal "screen-256color"
# mode keys vi
set -g mode-keys vi
# mouse mode on
set -g mouse off
bind m set -g mouse on \; display 'Mouse: ON'
bind M set -g mouse off \; display 'Mouse: OFF'
# word separators for automatic word selection
setw -g word-separators ' @"=()[]'
setw -ag word-separators "'"
# aggressive resize causes window to only resize to smallest client that is
# "actively" looking at the window
setw -g aggressive-resize on
# copy mode
bind Enter copy-mode
bind b list-buffers
bind p paste-buffer
bind P choose-buffer
# the following vi-copy bindings follow vim settings
bind -T edit-mode-vi Up send -X history-up
bind -T edit-mode-vi Down send -X history-down
bind -T copy-mode-vi Space send -X begin-selection
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi V send -X select-line
bind -T copy-mode-vi C-v run "tmux send -X rectangle-toggle; tmux send -X begin-selection"
bind -T copy-mode-vi [ send -X begin-selection
bind -T copy-mode-vi ] send -X copy-selection
bind -T copy-mode-vi H send -X start-of-line
bind -T copy-mode-vi L send -X end-of-line
# set terminal title
set -g set-titles on
# copy to OSX pasteboard
if 'which -s reattach-to-user-namespace' 'set -g default-command "reattach-to-user-namespace -l $SHELL"'
#if 'which -s reattach-to-user-namespace' 'bind -T copy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"'
#if 'which -s reattach-to-user-namespace' 'bind -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"'
#if 'which -s reattach-to-user-namespace' 'bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"'
if 'which -s pbcopy' 'bind -T copy-mode-vi Enter send -X copy-pipe-and-cancel pbcopy'
if 'which -s pbcopy' 'bind -T copy-mode-vi y send -X copy-pipe-and-cancel pbcopy'
if 'which -s pbcopy' 'bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel pbcopy'
# local config
if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'