-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
77 lines (58 loc) · 2.13 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
# ~/.tmux.conf
# Unbind existing tmux key bindings (except 0-9).
set-option -g renumber-windows on
# Allow using the mouse
set -g mouse on
# Set the prefix to both ^b and ^a.
set-option -g prefix2 C-b
# Reduce the delay after sending commands
set -s escape-time 1
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Set the base index for panes to 1 instead of 0
setw -g pane-base-index 1
# enable vim keys.
setw -g mode-keys vi
# Vim-like moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Move seamlessly between tmux panes and vim - to not clober the bindings of
# ctrl-j and ctrl-k for fzf panes we check that the focussed is vim first
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# Vim-like resize bindings
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Vim-like copy-paste
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
unbind p
bind p paste-buffer
# More straight forward key bindings for splitting
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# History
set -g history-limit 1000
# Colours
set-option -g default-terminal "tmux-256color"
set-option -sa terminal-overrides ',alacritty:RGB'
# Fix to make autoread work in nvim (recommended in :checkhealth)
set-option -g focus-events on
# Terminal emulator window title
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'
# Notifying if other windows has activities
setw -g monitor-activity on
set -g visual-activity on
# Clock
setw -g clock-mode-colour green
setw -g clock-mode-style 24
source-file ~/tmux-gruvbox-dark.conf