-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
75 lines (61 loc) · 2 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
# Initial setup
set -g default-terminal xterm-256color
set -g default-shell $SHELL
set -g status-keys emacs
set -g mouse on
set -g repeat-time 700
# Base index
set -g base-index 1
setw -g pane-base-index 1
# Prefix key
set -g prefix C-k
unbind C-k
unbind C-b
bind C-k send-prefix
# Clear history
bind C clear-history
# Vi key-binding on copy mode
setw -g mode-keys vi
bind p paste-buffer
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'y' send -X copy-selection
set -g renumber-windows on
## Window activity monitor
# setw -g monitor-activity on
# set -g visual-activity on
# Split window
bind s split-window -h -c '#{pane_current_path}'
bind S split-window -v -c '#{pane_current_path}'
# Use vi-style direction key to move focus pane
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
# Use vi-style direction key to reisze pane
bind -r K resize-pane -U 2
bind -r J resize-pane -D 2
bind -r H resize-pane -L 2
bind -r L resize-pane -R 2
# Show pane numbner
bind p display-panes
# Next / Previous pane
bind -r BSpace select-pane -t :.-
bind -r Space select-pane -t :.+
# Next / Previous window
bind -r N previous-window
bind -r n next-window
# Kill window
bind Escape confirm-before -p "kill-window #W? (y/n)" kill-window
bind x confirm-before -p "kill-window #W? (y/n)" kill-window
bind X confirm-before -p "kill-window #W? (y/n)" kill-window
# Fix pbcopy and pbpaste
#
# Require to install https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
#
# Ref. https://github.com/tmux/tmux/issues/543
set -g default-command "reattach-to-user-namespace -l ${SHELL}"
bind -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Easy config reload
bind r source-file ~/.tmux.conf \; display-message "tmux config reloaded."