-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
101 lines (80 loc) · 3.42 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
# tmux.conf by Daniel Kim (otter.pro)
# change default key-binding of action key to <ctrl><space>, instead of default <ctrl><b> or <a>
# OLD
# change default key-binding, switch from CTRL-b to CTRL-a, like `screen`
unbind C-b #remove previous key binding default (C-b)
set -g prefix C-a #set key-binding to C-a
#C-a C-a: currently quickly cycle pane
bind C-a select-pane -t :.+
#bind C-a last-pane # C-a C-a to go to last pane / toggle only
# so select-pane -t is better than last-pane
#bind C-a send-prefix # C-a C-a will send normal C-a.
#set -g prefix C-space #set key-binding to C-space
#bind C-space last-window # this will prevent sending normal C-space, and undo "send-prefix" a
# C-Space (no prefix) to tab to next window
# bind -n C-Space next-window
bind -n C-Space last-window # not sure if using last-window vs next-window
# OLD: Type C-a twice to go to previous window
# "<action> R" to reload tmux config. Cap R, not small R
# Small R is "refresh-client"
bind R \
source-file ~/.tmux.conf \;\
display 'reloaded .tmux.conf'
# (|) vertical pane, (-) horizontal pane
unbind %
#unbind \" # how to unbind double quote??
bind | split-window -h
bind - split-window -v
# first window/pane starts from #1 (not 0)
set -g base-index 1
setw -g pane-base-index 1
# vi key for copy/choice modes
setw -g mode-keys vi
# xterm-keys pass-through
setw -g xterm-keys on
# unicode
setw -g utf8 on
set -g status-utf8 on
##############################################
# enable mouse mode, to select pane, resize, etc.
# This also allows mouse to scroll (works only on iTerm)
# (this works on tmux version < 2.1)
##############################################
# setw -g mode-mouse on
# setw -g mouse-resize-pane on
# setw -g mouse-select-pane on
# setw -g mouse-select-window on
if-shell "[[ `tmux -V` == *1.9 ]]" \
'set -g mode-mouse on; set -g mouse-resize-pane on; set -g mouse-select-pane on; set -g mouse-select-window on;'
# tmux 2.1+ (newer tmux, incl osx 10.11)
# replaces all the mode-mouse*
# * however, I cannot seem to resize vertical pane (horiz works)
set -g -q mouse on
set -g mouse-utf8 on
# https://github.com/tmux/tmux/issues/145
# Start copy mode when scrolling up and exit when scrolling down to bottom.
# The "#{mouse_any_flag}" check just sends scrolls to any program running that
# has mouse support (like vim).
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
##############################################
# Visual settings
##############################################
# Make it work in 256color
set -g default-terminal "screen-256color"
# Highlight active window (status pane)--
# changes background of current active window to red
set-window-option -g window-status-current-bg red
#set -g status-right "#[fg=green] #h | %d %b %R"
# #H=hostname, #(shell-cmd). %d %b %R = Dates
set -g status-right "[#(whoami)@#H]"
# show window notifications
#setw -g monitor-activity on #prints "Activity ...". Annoying if often.
set -g visual-activity on #highlights window name when there's activity.
setw -g automatic-rename #automatically set window title
# change window-style
# default
set-window-option -g window-active-style 'bg=#181818'
set-window-option -g window-style 'bg=#181818'
set-window-option -g window-style 'bg=black'
set-window-option -g pane-active-border-style ''