-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
128 lines (99 loc) · 3.66 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
###
# Settings
###
# Source the tmux conf file
bind s source-file ~/.tmux.conf \; display "Reloaded!"
# Change prefix to C-f rather than C-b and unbind original prefix
set -ga prefix C-f
unbind C-b
# Send FocusLost and FocusGained events to tmux.
set -g focus-events on
# Issue tmux commands without delay
set -sg escape-time 0
# Start window index at 1 rather than 0
set -ga base-index 1
# Enable mouse mode and enable specific mouse options
set-option -ga mouse on
# Use correct default shell
set-option -g default-shell "${SHELL}"
# Set status bar background and foreground
setw -ga window-status-current-style fg=white,bg=red,bright
# Show thin light blue border around active pane
set-option -ga pane-active-border-style "fg=colour227"
set-option -ga pane-active-border-style "fg=colour45"
# Always renumber windows when one is killed
set-option -ga renumber-windows on
# Turn off military time. Note: View time with prefix t
setw -ga clock-mode-style 12
###
# Bindings
###
# Send the prefix key sequence to non tmux applications if you need to
# by pressing the prefix twice
bind C-a send-prefix
# Easier vertical and horizontal split shortcuts
bind | split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
# prefix-c opens a new window in the home directory. To open a new window in the
# current pane's pwd:
bind v new-window -c "#{pane_current_path}"
# Remap movement keys to vim bindings
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Move between windows with prefix ctrl h
# -r flag specifies that the binding is repeatable (so no need to specify
# the prefix every consecutive time)
bind -r M-h select-window -t :-
bind -r M-l select-window -t :+
# Easily resize panes
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Swap current window to the first window position
bind-key T swap-window -t 1
# Move the current window to the left/right.
bind-key M-h swap-window -t -1
bind-key M-l swap-window -t +1
##
# Copy-paste integration -- see
# http://evertpot.com/osx-tmux-vim-copy-paste-clipboard/
##
set-option -ga default-command "reattach-to-user-namespace -l ${SHELL}"
# Use vim keybindings in copy mode
set-window-option -ga mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# The following is necessary in bash:
# # Update default binding of `Enter` to also use copy-pipe
# unbind -t vi-copy Enter
# bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# Bind ']' to use pbpaste
# bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# Tmux continuum autosaves tmux session at regular intervals
set -g @continuum-restore 'on'
# This command toggles on or off the synchronize panes features, which sends a
# command to all panes
bind e set-window-option synchronize-panes
##
# tmux plugins (TPM)
##
# List of plugins
# Supports `github_username/repo` or full git repo URLs
# Tmux plugin manager
set -g @plugin 'tmux-plugins/tpm'
# Basic tmux settings
set -g @plugin 'tmux-plugins/tmux-sensible'
# Copy to system clipboard
set -g @plugin 'tmux-plugins/tmux-yank'
# Tmux resurrect: save and restore tmux sessions with prefix + <C-s> and prefix
# + <C-r>
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Tmux continuum: automatically save tmux session at regular intervals and
# restore on tmux server start
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'