/
.tmux.conf
94 lines (72 loc) · 2.46 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
# Change prefix key to Ctrl-f
unbind C-b
set -g prefix C-f
# Move detach session bind from home row
unbind d
bind ` detach
# Start numbering at 1 intead of 0
set -g base-index 1
set-window-option -g pane-base-index 1
# Last active window
unbind l
bind C-f last-window
# Kill window
bind C-k kill-window
# Ensure the new window opens with the same path
bind c new-window -c "#{pane_current_path}"
# More straight forward key bindings for splitting
unbind %
bind \\ split-window -h -c "#{pane_current_path}" # '|' key sans shift
unbind '"'
bind - split-window -v -c "#{pane_current_path}" # '-' key sans shift
# Pane
# Make choosing the pane similar to vi navigation
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
## Use the vi directions for resizing panes too
bind H resize-pane -L 5
bind L resize-pane -R 5
bind K resize-pane -U 5
bind J resize-pane -D 5
# Copy mode
unbind [
bind C-c copy-mode
# Paste mode
unbind ]
bind C-v paste-buffer
# move tmux copy buffer into x clipboard
bind-key C-y save-buffer /tmp/tmux-buffer \; run-shell "cat /tmp/tmux-buffer | xclip"
# Status Bar
set -g status-bg black
set -g status-fg white
set -g status-interval 1
set -g status-left '#[fg=green]#H#[default]'
set -g status-right "|#(echo $(python -c \"import socket;s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM);s.connect(('8.8.8.8', 80));print(s.getsockname()[0]);s.close()\"))| #[fg=blue,bold]%m-%d-%y #[fg=red,bold]--#[fg=white,bold]%I:%M:%S#[fg=red,bold]--#[default]"
# Notifying if other windows has activities
setw -g monitor-activity off
set -g visual-activity off
# Highlighting the active window in status bar
set-window-option -g window-status-current-style bg=red
# Clock
setw -g clock-mode-colour red
setw -g clock-mode-style 12
# History
set -g history-limit 100000
# Bind '<' and '>' to zoom and unzoom.
unbind >
bind > new-window -d -n tmux-zoom \; swap-pane -s tmux-zoom.1 \; select-window -t tmux-zoom
unbind <
bind < last-window \; swap-pane -s tmux-zoom.1 \; kill-window -t tmux-zoom
# Reload the config file
bind r source-file ~/.tmux.conf
if-shell "[[ `uname` == \"Darwin\" ]]" \
"set-option -g default-command 'reattach-to-user-namespace -l zsh'"
bind R \
set -g renumber-windows on\; \
new-window\; kill-window\; \
set -g renumber-windows off\; \
display-message "Windows reordered..."
set -sg escape-time 10