-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
53 lines (41 loc) · 1.8 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
# zsh is my shell
set-option -g default-shell $SHELL
# look good
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# fix delay after esc key
set -sg escape-time 0
# mouse support
set -g mouse on
# more scroll back buffer
set-option -g history-limit 5000
# use ` as prefix key, hit ` twice to send a ` to the buffer
unbind C-b
set -g prefix `
bind-key ` send-prefix
# easier mappings
bind s choose-tree -Ns # disable session preview
bind n split-window -c "#{pane_current_path}" # start a new horizontal pane
bind v split-window -h -c "#{pane_current_path}" # start a new vertical pane
bind b break-pane # create window from current pane
bind q kill-pane # close current pane
bind w confirm-before -p "kill-window #W? (y/n)" kill-window # close current window
bind Enter next-layout
bind l switch-client -l # select last session
# one based index, switching between window 0 and 1 is a pain
set -g base-index 1
set -g pane-base-index 1
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(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 Space if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# better highlight current window
set-window-option -g window-status-current-format '#I:#[fg=colour7,bold]#W#F'
set-hook -g client-session-changed 'run-shell "echo -ne \"\ePtmux;\e\033]1337;PopKeyLabels\a\e\\\""'
# Plugins
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run "~/.tmux/plugins/tpm/tpm"