-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
116 lines (87 loc) · 3.05 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin "jlipps/tmux-safekill"
set -g default-command "${SHELL}"
# Increase scrollback buffer
set -g history-limit 500000
set -s escape-time 0
set-option -s set-clipboard off
# Reorganize window indexes automatically
set-option -g renumber-windows on
# Tmux colorscheme
source-file ~/dotfiles/tmux.colorscheme.conf
# TMUX auto renaming
setw -g automatic-rename off
# Kill pane without confirmation
bind-key x kill-pane
# Force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "TMUX conf reloaded!"
# Enable mouse mode
set -g mouse on
# Use prefix C-l to clear the visible scrollback lines
bind-key C-l send-keys 'C-l'
# Use prefix C-k to clear the scrolled off (hidden) buffer lines
bind-key C-k clear-history
# C-z zoom current pane
unbind C-z
bind -n C-z resize-pane -Z
# tmux vi
setw -g mouse on
setw -g mode-keys vi
# Use v to trigger selection
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle \; send -X begin-selection
# Use y to yank current selection
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind -T copy-mode-vi y send -X copy-pipe "xclip -sel clip -i"
unbind C-[
bind C-[ copy-mode
# Screen like binding
unbind C-b
set -g prefix C-a
bind a send-prefix
bind-key S choose-session
# Create splits and vertical splits
bind-key v split-window -h -l 50% -c "#{pane_current_path}"
bind-key ^V split-window -h -l 50% -c "#{pane_current_path}"
bind-key s split-window -l 50% -c "#{pane_current_path}"
bind-key ^S split-window -l 50% -c "#{pane_current_path}"
# Move window indexes
bind-key C-S-Left swap-window -t -1\; select-window -t -1
bind-key C-S-Right swap-window -t +1\; select-window -t +1
# Use prefix C-k to clear the scrolled off (hidden) buffer lines
bind-key C-k clear-history \; display "Pane history cleared!"
# Clear pane
bind-key C-l send-keys C-l
# Break pane into a tmux window
bind b break-pane -d
# Join pane from another tmux tab (joins the last selected pane from that window)
bind-key j command-prompt -p "join pane from: " "join-pane -h -s '%%'"
# Tmux pane swap
bind -n C-M-Left swap-pane -s "{left-of}"
bind -n C-M-Right swap-pane -s "{right-of}"
bind -n C-M-Up swap-pane -s "{up-of}"
bind -n C-M-Down swap-pane -s "{down-of}"
#
# # Tmux resize
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 1
bind -n S-Up resize-pane -U 1
#
bind -n C-Left resize-pane -L 10
bind -n C-Right resize-pane -R 10
bind -n C-Down resize-pane -D 5
bind -n C-Up resize-pane -U 5
# C-z zoom current pane
unbind C-z
bind -n C-z resize-pane -Z
set -g focus-events on
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run -b '~/.tmux/plugins/tpm/tpm'