-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
79 lines (67 loc) · 2.53 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
# bind to ctrl-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# plugins list
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-yank'
# fetch tpm if not present
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# activate plugins (C-a I to install if not present)
run '~/.tmux/plugins/tpm/tpm'
# automatically renumber tmux windows
set -g renumber-windows on
# windows and panes indexes start at one
set -g base-index 1
setw -g pane-base-index 1
# new-window should open on home instead of on the current path
unbind c
bind c new-window -c "$HOME"
# and ensure that new panes retain the current path
# see https://github.com/gpanders/dotfiles/commit/81679fcfe349e1ee26f7ccced18e6472222f4ac5
#set -g default-shell /bin/sh
#set -g default-command $SHELL
# cycle windows
unbind ^A
bind ^A last-window
# vi-like copy mode
setw -g mode-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
# alt (lifted from jabirali/tmux-tilish)
bind -n M-1 if-shell "tmux select-window -t 1" "" "new-window -t 1"
bind -n M-2 if-shell "tmux select-window -t 2" "" "new-window -t 2"
bind -n M-3 if-shell "tmux select-window -t 3" "" "new-window -t 3"
bind -n M-4 if-shell "tmux select-window -t 4" "" "new-window -t 4"
bind -n M-5 if-shell "tmux select-window -t 5" "" "new-window -t 5"
bind -n M-6 if-shell "tmux select-window -t 6" "" "new-window -t 6"
bind -n M-7 if-shell "tmux select-window -t 7" "" "new-window -t 7"
bind -n M-8 if-shell "tmux select-window -t 8" "" "new-window -t 8"
bind -n M-9 if-shell "tmux select-window -t 9" "" "new-window -t 9"
bind -n M-0 if-shell "tmux select-window -t 10" "" "new-window -t 10"
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R
bind -n M-H swap-pane -s '{left-of}'
bind -n M-J swap-pane -s '{down-of}'
bind -n M-K swap-pane -s '{up-of}'
bind -n M-L swap-pane -s '{right-of}'
bind -n M-n command-prompt -p 'Workspace name:' 'rename-window %%'
bind -n C-M-q kill-pane
bind -n M-h resize-pane -L 5
bind -n M-j resize-pane -D 5
bind -n M-k resize-pane -U 5
bind -n M-l resize-pane -R 5
# theme
source-file "${HOME}/.tmux/basic.tmuxtheme"
# dim inactive panes
set -g window-style fg=colour8,bg=colour236
set -g window-active-style fg=colour7,bg=colour0