-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
73 lines (56 loc) · 2.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
63
64
65
66
67
68
69
70
71
72
73
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
set-window-option -g mode-keys vi
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
# updated: vi style directions (crtl hjkl)
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# neovim
set-option -sg escape-time 10
# easy reload of tmux.conf
bind r source-file ~/.tmux.conf
# Enable mouse mode (tmux 2.1 and above)
set -g mouse
# Set the current working directory based on the current pane's current
# # working directory (if set; if not, use the pane's starting directory)
# # when creating # new windows and splits.
bind-key c new-window -c '#{pane_current_path}'
bind-key '"' split-window -c '#{pane_current_path}'
bind-key % split-window -h -c '#{pane_current_path}'
# Don't detach completely when a session is destroyed; instead switch to the next session.
set -g detach-on-destroy off
# Renumber the remaining windows when one is destroyed. Means the windows are always 1-n.
set -g renumber-windows on
# Prevent windows from renaming when running commands
set-option -g allow-rename off
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# scrolls nicely
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
# system restarts
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-battery'
# /plugins
# starts tmux server on restart
# set -g @continuum-restore 'on'
#import status conf
source ~/.tmux.status.conf
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
# keep this here, plugin manager
run '~/.tmux/plugins/tpm/tpm'