-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
82 lines (60 loc) · 2.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
# Status bar has a dim gray background
set-option -g status-bg colour234
set-option -g status-fg colour255
set-option -g status-left-bg default
set-option -g status-left-fg colour74
set-option -g status-right-bg default
set-option -g status-right-fg colour248
set-option -g status-justify left
set-option -g status-interval 60
# highlight current window
set-window-option -g window-status-current-bg red
set-option -g pane-active-border-fg green
# status bar
set -g status-left-length 36
set -g status-left ' #(curl ipecho.net/plain;echo) #[fg=colour248]#(ipconfig getifaddr en0 || ipconfig getifaddr en1) #[fg=colour74]|'
set -g status-right '#(battery -p -t) %a %d %b %H:%M '
# force utf8 support
set-option -g utf8 on
set-option -g status-utf8 on
# allow mouse for selecting active pane
setw -g mode-mouse on
set-option -g mouse-select-pane on
set -g mouse-resize-pane on
# key bindings
set-option -g prefix C-f
unbind-key C-b
bind-key a send-prefix
bind-key C-f last-window
unbind %
bind | split-window -h
set-option -sg escape-time 0
set-option -g base-index 1
set-window-option -g pane-base-index 1
set-option -g default-terminal screen-256color
set-window-option -g xterm-keys on
set-option -g set-titles on
set-option -g set-titles-string '[#S:#I #H] #W'
# History
set -g history-limit 10000
# Only constrain size if smaller client is active
setw -g aggressive-resize on
# Make vim copy to system clipboard work in OSX
set-option -g default-command "reattach-to-user-namespace -l bash"
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Smart pane switching with awareness of vim splits
# https://gist.github.com/mislav/5189704
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l"
# panel resizing
bind - resize-pane -D 5
bind = resize-pane -U 5
bind < resize-pane -L 5
bind > resize-pane -R 5