-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.tmux.conf
More file actions
96 lines (73 loc) · 2.49 KB
/
.tmux.conf
File metadata and controls
96 lines (73 loc) · 2.49 KB
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
#set-option -g default-command "reattach-to-user-namespace -l zsh"
set -g default-terminal "screen-256color"
set -g history-limit 20000
# use VI
set-window-option -g mode-keys vi
set -s escape-time 0
# Use ctrl-a instead of ctrl-b
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# reload config
unbind r
bind r source-file ~/.tmux.conf
unbind ^T
bind ^T split-window -h -p 25
# horizontal and vertical splits
unbind |
bind | split-window -h
unbind _
bind _ split-window
# tile all windows
unbind =
bind = select-layout tiled
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe 'reattach-to-user-namespace pbcopy'
# cycle through panes
unbind ^A
bind ^A select-pane -t :.+
unbind +
bind + resize-pane -Z
unbind Right
bind Right resize-pane -R 8
unbind Left
bind Left resize-pane -L 8
unbind Up
bind Up resize-pane -U 4
unbind Down
bind Down resize-pane -D 4
unbind h
bind h select-pane -L
unbind j
bind j select-pane -D
unbind k
bind k select-pane -U
unbind l
bind l select-pane -R
bind C-k send-keys -R \; clear-history
# status bar
set -g status-bg black
set -g status-fg white
set -g status-interval 1
set -g status-right-length 60
set -g renumber-windows on
set -g base-index 1
set -g status-left ' '
set -g status-right '#(battery-life) (#(battery-time)) #[fg=yellow]%d %b %R#[default] '
set-window-option -g window-status-current-bg yellow
set-window-option -g window-status-current-fg black
setw -g utf8 on
set -g status-utf8 on
# Setup 'v' to begin selection as in Vim #from NickG
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe #from NickG
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
set-option -g status-keys vi
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"