-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.tmux.conf
103 lines (76 loc) · 3 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Based on Chris Hunt's tmux config
# https://github.com/chrishunt/dot-files
# use 256 term for pretty colors
set -g status-bg colour235
# start window index at 1
set -g base-index 1
# start pane index at 1
setw -g pane-base-index 1
#shell
set-option -g default-shell /opt/homebrew/bin/fish
# set-option -g default-command "reattach-to-user-namespace -l /opt/homebrew/bin/fish"
#powerline
source-file ~/.tmuxline
# Mouse options
set -g mouse on
############################
## Key Bindings #
############################
#tmux prefix
unbind C-b
set -g prefix C-space
# window splitting
unbind %
bind | split-window -h -c '#{pane_current_path}'
unbind '"'
bind - split-window -v -c '#{pane_current_path}'
# resize panes
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
# create 25% lower split
unbind t
bind t split-window -p 25
# quickly switch panes
bind ^space next-window
# emacs esc lag
set -s escape-time 0
# Smart pane switching with awareness of vim splits
is_vim_emacs='echo "#{pane_current_command}" | \
grep -iqE "((^|\/)g?(view|n?vim?x?)(diff)?$)|emacs"'
# enable in root key table
bind -n C-h if-shell "$is_vim_emacs" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim_emacs" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim_emacs" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim_emacs" "send-keys C-l" "select-pane -R"
bind -n C-] if-shell "$is_vim_emacs" "send-keys C-]" "select-pane -l"
bind C-l send-keys 'C-l'
# enable in copy mode key table
bind -Tcopy-mode-vi C-h if-shell "$is_vim_emacs" "send-keys C-h" "select-pane -L"
bind -Tcopy-mode-vi C-j if-shell "$is_vim_emacs" "send-keys C-j" "select-pane -D"
bind -Tcopy-mode-vi C-k if-shell "$is_vim_emacs" "send-keys C-k" "select-pane -U"
bind -Tcopy-mode-vi C-l if-shell "$is_vim_emacs" "send-keys C-l" "select-pane -R"
bind -Tcopy-mode-vi C-] if-shell "$is_vim_emacs" "send-keys C-]" "select-pane -l"
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# open new pane in current working directory
bind c new-window -c '#{pane_current_path}'
# pane movement
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key s command-prompt -p "s pane to:" "join-pane -t '%%'"
# fix terminal colors
set -g default-terminal "${TERM}"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
# set -g default-terminal "xterm-24bit"
# set -g terminal-overrides ',xterm-24bit:Tc'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'jonmosco/kube-tmux'
#set -g @plugin 'tmux-plugins/tmux-sensible'
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'