-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
85 lines (65 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
# Use ` as prefix
unbind C-b
set -g prefix `
# Type `` to send the ` character itself
bind ` send-prefix
# Use C-a as a secondary prefix
set -g prefix2 C-a
# True colors
set-option -ga terminal-overrides ",xterm-256color:Tc" # add truecolor support
set -g default-terminal "screen-256color" # default terminal is 256 colors
# Number windows starting from 1
set -g base-index 1
# Do not rename windows automatically
set-option -g allow-rename off
# Switch to another session when the last page of the current session is terminated
set-option -g detach-on-destroy off
# Use vi key bindings to navigate buffer
set-option -g status-keys vi
set-window-option -g mode-keys vi
# vi-like visual block selection and yank to clipboard
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# Enable mouse
set -g mouse on
# Long buffer history
set -g history-limit 30000
# Open new windows and panes in the "current" workdir
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind-key b split-window -h -c "#{pane_current_path}"
bind-key v split-window -v -c "#{pane_current_path}"
# Join and split panes to/from windows
bind-key M choose-window "join-pane -h -t '%%'"
# hjkl to move aound panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# custom key bindings for session management
bind N command-prompt -p "New session:" "new-session \; rename-session '%%'"
bind W new-session \; rename-session 'wiki' \; send-keys "vw" Enter
bind X new-session \; rename-session 'xp'
# Status bar
set -g status-right "#P | %Y/%m/%d %H:%M"
source-file ~/.tmux.colors.dark.conf
#
# Plugins
#
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @override_copy_command 'xsel -i -b'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-strategy-vim 'session'
run -b '~/.tmux/plugins/tpm/tpm'
# Seamless navigation between vim and tmux panes
set -g @plugin 'christoomey/vim-tmux-navigator'
run '~/.tmux/plugins/tpm/tpm'
# .. but get my SIGQUIT back!
unbind -n C-\\