-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf.local
58 lines (48 loc) · 2.02 KB
/
.tmux.conf.local
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
######## Settings
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
######## Binds
# reload configuration
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# resize panes
bind-key -n S-M-Right resize-pane -R 10
bind-key -n S-M-Up resize-pane -U 5
bind-key -n S-M-Down resize-pane -D 5
bind-key -n S-M-Left resize-pane -L 10
bind-key -n S-Right resize-pane -R 2
bind-key -n S-Up resize-pane -U 1
bind-key -n S-Down resize-pane -D 1
bind-key -n S-Left resize-pane -L 2
# navigate panes
bind-key -n C-h select-pane -L
bind-key -n C-j select-pane -D
bind-key -n C-k select-pane -U
bind-key -n C-l select-pane -R
# split panes
bind-key - split-window -v -c '#{pane_current_path}'
bind-key _ split-window -h -c '#{pane_current_path}'
# new window
bind c new-window -c '#{pane_current_path}'
# break pane
bind-key b break-pane -d
# session navigation
bind-key C-j choose-tree
####################### copy mode #############################################
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
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
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
######################## gitsh @###############################################
bind-key g split-window -v -p 20 gitsh --git .
######################### vim integration #####################################
# Smart pane switching with awareness of vim splits
# # See: https://github.com/christoomey/vim-tmux-navigator
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"