forked from sontek/homies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_tmux.conf
147 lines (103 loc) · 3.6 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# start window index of 1
set-option -g base-index 1
setw -g pane-base-index 1
# sane scrolling
# set-option -g terminal-overrides 'xterm*:smcup@:rmcup@'
# UTF-8
set-option -g status-utf8 on
#supposedly fixes pausing in vim
set-option -sg escape-time 1
set-window-option -g mode-mouse on
set-option -g mouse-select-pane on
set-option -g mouse-resize-pane on
set-option -g mouse-select-window on
# act like vim
set-window-option -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# # act like GNU screen
unbind C-b
set -g prefix C-a
# Allow C-A a to send C-A to application
bind C-a send-prefix
# Reload key
bind r source-file ~/.tmux.conf
# # look good
set -g default-terminal "screen-256color"
set -g history-limit 5000
setw -g xterm-keys on
# # Rebinding the pane splitting bindings
# unbind % # Remove default bindings since we're replacing
bind | split-window -h
bind - split-window -v
# Open panes in new window
unbind v
unbind n
bind v send-keys " ~/tmux-panes -h" C-m
bind n send-keys " ~/tmux-panes -v" C-m
# # Set window notifications
setw -g monitor-activity on
set -g visual-activity on
# panes
bind-key -r J resize-pane -D 5
bind-key -r K resize-pane -U 5
bind-key -r H resize-pane -L 5
bind-key -r L resize-pane -R 5
set-option -g pane-border-fg green
set-option -g pane-border-bg black
set-option -g pane-active-border-fg white
set-option -g pane-active-border-bg yellow
# statusbar --------------------------------------------------------------
# # default statusbar colors
set-option -g status-fg white
set-option -g status-bg black
set-option -g status-attr default
# # default window title colors
set-window-option -g window-status-fg cyan
set-window-option -g window-status-bg default
set-window-option -g window-status-attr dim
# # active window title colors
set-window-option -g window-status-current-fg white
set-window-option -g window-status-current-bg red
set-window-option -g window-status-current-attr bright
# # command/message line colors
set-option -g message-fg white
set-option -g message-bg black
set-option -g message-attr bright
# # Refresh the status bar every 30 seconds.
set-option -g status-interval 30
# # The status bar itself.
set -g status-justify centre
set -g status-left-length 40
set -g status-left "#[fg=#009900]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
set -g status-right "#[fg=blue]#(~/battery Discharging) | #[fg=cyan]%d %b %R"
set-option -g display-time 1000
# Reload source file
bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded"
# Macros
# Show url in buffer
bind C-o run-shell "open $(tmux show-buffer)"
# Pipe pane to log file
bind-key P pipe-pane -o "cat >>$HOME/#W-tmux.log" \; display-message "Toggled logging to $HOME/#W-tmux.log"
# Maximize and restore panes. Don't switch windows between using these :)
# maximize
unbind Up
bind Up neww -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
# Restore
unbind Down
bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp
# Sync panes
bind C-s set-window-option synchronize-panes
# OSX Clipboard support
source ~/.tmux.clipboard
bind C-v run "tmux set-buffer $(reattach-to-user-namespace pbpaste); tmux paste-buffer"
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
# Linux clipboard support
bind C-p run "tmux set-buffer \"$(xclip -o -selection clipboard)\"; tmux paste-buffer"
bind C-y run "tmux save-buffer - | xclip -i -selection clipboard"
# Clear the current pane AND clear the pane's history
bind C-k send-keys 'C-l'\; clear-history