-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
63 lines (48 loc) · 2.23 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
# @see https://github.com/gpakosz/.tmux for inspiration
# @see https://github.com/rothgar/awesome-tmux for inspiration
source "~/dotfiles/tmux-gruvbox-light.conf"
unbind C-b
set -g prefix C-t
set -g mouse on
set -g default-terminal "screen-256color"
set -g history-limit 10000
# Allow copy with mouse and scroll with mouse wheel
# See https://unix.stackexchange.com/a/560530/280105
bind-key -T copy-mode-vi v send -X begin-selection
if-shell -b 'echo $XDG_SESSION_TYPE | grep -q x11' "\
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard > /dev/null'; \
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard > /dev/null'; \
bind-key C-p run 'xclip -out -selection clipboard | tmux load-buffer - ; tmux paste-buffer'"
if-shell -b 'echo $XDG_SESSION_TYPE | grep -q wayland' "\
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'wl-copy'; \
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'wl-copy'; \
bind-key C-p run 'wl-paste --no-newline | tmux load-buffer - ; tmux paste-buffer'"
bind -n End send-key C-e
bind -n Home send-key C-a
bind | split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
# Use Shift-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Allow to move between words
set-window-option -g xterm-keys on
# Automatically set window title
set-window-option -g automatic-rename on
set-window-option -g automatic-rename-format '#{b:pane_current_path}'
# notify when a window has activity
set-window-option -g monitor-activity on
# Alt arrow to switch windows
bind -n M-S-Left previous-window
bind -n M-S-Right next-window
# attempt to set the client terminal title
set -g set-titles on
# No delay for escape key press
set -sg escape-time 0
# Clear screen with CTRL-L
bind -n C-l send-keys C-l \; send-keys -R \; clear-history
# Copy mode search with a simple shortcut (@see https://superuser.com/a/1253137)
bind-key / copy-mode \; send-key ?
# Bind key to reload tmux config
bind r source ~/.tmux.conf\; display "~/.tmux.conf sourced!"