-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
82 lines (65 loc) · 2.09 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
# Make it use C-a, similar to GNU screen..
set -g prefix C-a
unbind C-b
bind a send-prefix
# switch to last pane
bind C-a last
# improve colors
set -g default-terminal "screen-256color-italic"
# increase scrollback lines
set -g history-limit 1000
# panel {{{1
# use -,\ to split window horizontally,vertically
unbind '"'
bind - splitw -v
unbind %
bind \ splitw -h
# 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"
# To resize a split, just use this:
bind -r ^l resize-pane -R 10
bind -r ^j resize-pane -D 10
bind -r ^k resize-pane -U 10
bind -r ^h resize-pane -L 10
# exchange location of pane
bind C-u swapp -U
bind C-d swapp -D
# }}}
# Windows {{{1
# start windows numbering at 1
set -g base-index 1
# start pane numbering at 1
setw -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# }}}
# mouse {{{1
set -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-select-window on
set -g mouse-resize-pane on
# }}}
# copy mode {{{1
#
# hit prefix + [ to enter copy mode.
#
# Use vim keybindings in copy mode
# "tmux list-keys -t vi-copy" list key-binding in vi-copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
if 'which -s reattach-to-user-namespace' 'bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"'
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
if 'which -s reattach-to-user-namespace' 'bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"'
# }}}
# support automatically jump back
bind m command-prompt "splitw -v 'exec man %%'"
bind s command-prompt "neww 'exec ssh %%'"
# provide an alternate mapping to clear-screen
bind C-c send-keys 'C-l'
# vim: set foldlevel=0 foldmethod=marker: