forked from napcs/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
executable file
·139 lines (102 loc) · 4.04 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
set-option -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# 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
# 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
# # 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]#(~/bin/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 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
# clipboard
bind-key -t vi-copy v begin-selection
# OSX Clipboard
if-shell "[ -f ~/.tmux.osx.clipboard ]" 'source ~/.tmux.osx.clipboard'
# Linux clipboard support
if-shell "[ -f ~/.tmux.linux.clipboard ]" 'source ~/.tmux.linux.clipboard'
# Clear the current pane AND clear the pane's history
bind C-l send-keys 'C-l'
bind C-k send-keys 'C-l'\; clear-history
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-\\') || tmux select-pane -l"