-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
94 lines (70 loc) · 2.36 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
83
84
85
86
87
88
89
90
91
92
93
# Change prefix
set -g prefix C-s
unbind C-b
bind C-s send-prefix
# Reload tmux config
unbind r
bind r source-file ~/.tmux.conf
# OPTIONS ######################################################################
# Use vim key bindings
set-window-option -g mode-keys vi
# Mouse mode
# set -g mouse on
# Send focus events for vim
set -g focus-events on
# Keep a lot of shell history
set-option -g history-limit 2000000
# Set the default terminal mode to 256color mode
set -g default-terminal "xterm-256color"
# Neovim asked for this
set-option -sg escape-time 10
# BINDINGS #####################################################################
# Refresh client
bind C-r refresh-client
# Cycle through windows
bind C-s last-window
bind -n C-Tab select-window -t :+
bind -n C-S-Tab select-window -t :-
# Search history
bind / copy-mode \; send-keys ?
# Scroll up into copy mode
bind C-b copy-mode -u
# Split panes
bind \\ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# Join windows
bind J command-prompt -p "join pane from:" "join-pane -s '%%'"
bind s command-prompt -p "send pane to:" "join-pane -t '%%'"
# Copy paste
bind -T copy-mode-vi 'v' send-keys -X begin-selection
bind -T copy-mode-vi 'y' send-keys -X copy-pipe "xclip -selection c"
# Copy/paste over ssh from tmux, see: https://gist.github.com/burke/5960455
bind C-c run "tmux save-buffer - | pbcopy-remote"
bind -T copy-mode-vi 'C-c' send-keys -X copy-pipe "pbcopy-remote"
bind C-v run "tmux set-buffer $(pbpaste-remote); tmux paste-buffer"
bind C-o run "tmux save-buffer - | chropen"
# Copy locally
bind y run "tmux save-buffer - | xclip -selection c"
bind o run "tmux save-buffer - | chropen"
# Create a new window
bind Space new-window -c "#{pane_current_path}"
# for easier rolling without worrying about letting go of ctrl
bind C-Space new-window -c "#{pane_current_path}"
bind C-d detach-client
# to act like vim
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# to move windows
bind S-Left swap-window -t -1
bind S-Right swap-window -t +1
# DISPLAY ######################################################################
set -g status-justify centre
set -g status-style bg=default
set -g status-style fg=white
set -g status-left ''
set -g status-right '(%H:%M)'