-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
61 lines (48 loc) · 1.75 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
set-option -g prefix C-a
unbind-key C-b
set -g base-index 1
set -g pane-base-index 1
set -g default-terminal "screen-256color"
# decrease command delay (increases vim's responsiveness)
set -sg escape-time 1
bind r source-file ~/.tmux.conf
set -g utf8
set-option -g status-utf8 on
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
setw -g mode-key vi
#split windows
unbind v
unbind h
bind | split-window -h
bind - split-window -v
bind-key C-x kill-pane
bind-key C-q kill-window
bind-key C-c neww
# Reload key
bind C-r source-file ~/.tmux.conf \; display-message "Configuration reloaded"
# vim default copy bindings
#bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
bind y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
bind C-y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
#set-option -g default-command "reattach-to-user-namespace -l zsh"
## mouse mode on
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
# 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"
# Clear history
bind -n C-k clear-history
bind C-l send-keys 'C-l'