-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
81 lines (62 loc) · 1.94 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
#----------------
# General
#----------------
# use utf-8
# set -g utf8
# set-window-option -g utf8 on
# setw -g xterm-keys on
set -s escape-time 10
set-option -g focus-events on
# set -sg repeat-time 600
# set -s focus-events on
# set scrollback history to 10k
set -g history-limit 10000
# change prefix to Ctrl-a (like screen)
# unbind-key C-a
# unbind-key 'C-\'
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# set colors to 256
set -g default-terminal "screen-256color"
# reload ~/.tmux.conf using PREFIX r
bind-key r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
# resizing panes with Alt
bind-key -r M-j resize-pane -L
bind-key -r M-k resize-pane -D
bind-key -r M-l resize-pane -U
bind-key -r M-\; resize-pane -R
# selecting panes
bind-key j select-pane -L
bind-key k select-pane -D
bind-key l select-pane -U
bind-key \; select-pane -R
# close window
bind-key Q kill-window
# dev mode (creates two panes: one 75% of the screen on top of the other one)
bind-key D source-file ~/.tmux/.tmux.conf.dev
# Override splitting panes to create panes in the same working directory was the current one
bind-key % split-window -h -c '#{pane_current_path}'
bind-key \" split-window -v -c '#{pane_current_path}'
#---------------------
# Copy & Paste
#---------------------
# enter copy mode by PREFIX + C
bind-key C copy-mode -t :.
# use vi mode in copy
set-window-option -g mode-keys vi
# remap navigation keys to the mapping I'm using in vimrc
bind-key -T copy-mode-vi j send-keys -X cursor-left
bind-key -T copy-mode-vi k send-keys -X cursor-down
bind-key -T copy-mode-vi l send-keys -X cursor-up
bind-key -T copy-mode-vi \; send-keys -X cursor-right
# remap v and y to work as in vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
# remap p to paste just like in vim
unbind-key p
bind p paste-buffer
#--------------------
# Roger's tmux-hints
#--------------------
bind u run tmux-hints