-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
62 lines (46 loc) · 2 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
set -g default-shell $SHELL
# source osx specific configuration
if-shell 'test "$(uname)" = "Darwin"' 'source ~/.tmux-osx.conf'
unbind C-b
set -g prefix '\'
bind '\' send-prefix
# Setting delay after prefix command to avoid interference with VIM
set -s escape-time 1
# increase scrollback buffer size
set -g history-limit 50000
# tmux messages are displayed for longer time
set -g display-time 2000
# Window & pane index starts from 1
set -g base-index 1
set -g pane-base-index 1
# Reload tmux config with prefix-r
bind r source-file ~/.tmux.conf
# split panes like vim
bind v split-window -h -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Since s -> list session is binded to split-window above
# Changed this.. a -> all sessions
bind a choose-tree -Zs
# Copy mode bindings
unbind [
unbind ]
bind ] copy-mode
# vim bindings for copy
setw -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# 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"
# Mouse support - off - Not able to select by double clicking is annoying
set -g mouse off
# To be used with iterm
# set-option -ga terminal-overrides ",xterm-256color:Tc"
# Add true color & italics support with alacritty terminal
set -g default-terminal "alacritty"
set -g @plugin 'egel/tmux-gruvbox'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'