-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
73 lines (52 loc) · 2.49 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
# TODO:
# brew install reattach-to-user-namespace
# 256 colors for vim
set -g default-terminal "screen-256color"
# Start window numbering at 1
set-option -g base-index 1
set-window-option -g pane-base-index 1
# Auto renumber when windows are closed
set-option -g renumber-windows on
# Cycle panes with C-b C-b
unbind ^B
bind ^B select-pane -t :.+
# Reload config with a key
bind-key r source-file ~/.tmux.conf \; display "Config reloaded!"
# Mouse works as expected
set -g mouse on
# Scrolling works as expected
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Use the system clipboard
# set-option -g default-command "reattach-to-user-namespace -l bash"
# Clear the pane and it's history
bind -n 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 -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"
# C-l is taken over by vim style pane navigation
bind C-l send-keys 'C-l'
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -se c -i"
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -se c -i"
# Pane resizing (control-b-[j|k|l|h])
bind j resize-pane -D 10
bind k resize-pane -U 10
# bind l resize-pane -L 10
# bind h resize-pane -R 10
set -g @resurrect-strategy-vim 'session'
set -g @continuum-restore 'on'
run-shell ~/dotfiles/tmux-resurrect/resurrect.tmux
run-shell ~/dotfiles/tmux-continuum/continuum.tmux
set -g status-right "#(whoami)@#(hostname) | #(/bin/bash $HOME/dotfiles/kube.tmux 250 black black)"
# https://github.com/roxma/vim-tmux-clipboard
# https://www.reddit.com/r/vim/comments/7tt4ts/painless_copy_paste_between_tmux_vim_and_system/dtgwdbk/
set -g focus-events on
set -sg escape-time 0