-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
94 lines (73 loc) · 2.79 KB
/
tmux.conf
File metadata and controls
94 lines (73 loc) · 2.79 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
# Reset keybindings
source-file ~/.tmux.reset.conf
# Set default terminal
set -g default-terminal "xterm-256color"
# Set prefix (meta)
set -g prefix C-f
# Set escape time to zero
set -s escape-time 0
# Scrollback buffer (history) size
set -g history-limit 42000
# Vi(m) style keys
setw -g mode-keys vi
setw -g status-keys vi
# Pass xterm keys (Ctrl-Tab in .Xresources)
set-option -gw xterm-keys on
# If version greater equal to 2.4
# Copy buffer to X clipboard sync
bind-key -T copy-mode-vi 'v' send -X begin-selection
# tr bit removes all non-ascii characters
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'tr -cd "\11\12\15\40-\176" | xclip -selection clipboard'
bind ] run "xclip -o | tmux load-buffer - ; tmux paste-buffer"
# For nested tmux sessions
bind-key -n C-a send-prefix
# split windows like my i3 setup
unbind i
bind i split-window -h -c '#{pane_current_path}'
unbind I
bind I split-window -v -c '#{pane_current_path}'
# Navigate Vim Tmux splits, not perfect but fairly good
bind -n C-h run "(tmux display-message -p '#{pane_title}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_title}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_title}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_title}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
# Move window order
bind C-h swap-window -t -1
bind C-l swap-window -t +1
# resize panes
bind H resize-pane -L
bind J resize-pane -D
bind K resize-pane -U
bind L resize-pane -R
# Clipboard behaviour
set-option set-clipboard on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Windows start at one
set -g base-index 1
setw -g pane-base-index 1
# Reload Config
bind-key r source-file ~/.tmux.conf
# Mouse Control on for now
set -g mouse on
# Pane Colours
set -g pane-border-fg black
set -g pane-active-border-fg brightred
# Other Colours
set -g message-bg blue
set -g message-command-bg blue
setw -g mode-bg blue
# Like Powerline
set -g status on
set -g status-interval 2
set -g status-fg colour231
set -g status-bg colour234
set -g status-left-length 20
set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold]'
set -g status-right '#F'
set -g status-right-length 150
set -g window-status-format "#[fg=colour240]┃#[fg=colour244]#I:#[fg=colour249]#W#[fg=colour240]┃"
set -g window-status-current-format "#[fg=colour31,bg=colour31]┃#[fg=colour117]#I:#[fg=colour231]#W#[fg=colour31]┃"
# Update environment
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
set-environment -g SSH_AUTH_SOCK $HOME/.ssh/ssh-auth-sock.$HOSTNAME
run-shell ~/bin/tmux-resurrect/resurrect.tmux