-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
114 lines (101 loc) · 3.91 KB
/
Copy pathtmux.conf
File metadata and controls
114 lines (101 loc) · 3.91 KB
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
# cat << EOF > /dev/null
#### General Settings ####
# Force 256 color support.
set -g default-terminal "tmux-256color"
#set -ga terminal-overrides ',xterm-256color:Tc'
# https://gist.github.com/bbqtd/a4ac060d6f6b9ea6fe3aabe735aa9d95
set -ga terminal-overrides ',xterm-256color:RGB'
#set -g terminal-overrides "screen*:colors=256"
# OSC 52 system clipboard (iTerm2: requires "Applications may access clipboard")
set -ga terminal-features ',tmux-256color:clipboard'
set -g set-clipboard on
# Place statusbar at top
set-option -g status-position top
# Increase scrollback
set -g history-limit 100000
# Start numbering windows at 1
set -g base-index 1
# Disable escape delay for vim
set -s escape-time 0
# Resize a window based on the smallest client actually viewing it,
# not on the smallest one attached to the entire session.
setw -g aggressive-resize on
# C-B s to toggle pane synchronization
bind-key s setw synchronize-panes
# C-B l to clear the scrollback buffer
bind-key C-l clear-history
# refresh 'status-left' and 'status-right' more often
set -g status-interval 5
# focus events enabled for terminals that support them
set -g focus-events on
# visual bell only
set -g visual-bell on
# force a reload of the config file
bind r source-file ~/.tmux.conf \; display 'sourced ~/.tmux.conf'
# Despite the confusing name, this doesn't prevent manual window renaming.
# Instead, it prevents a window from being automatically renamed after
# it's been manually renamed.
set-option -g allow-rename off
# Automatically renumber windows when one is closed
set-option -g renumber-windows on
# Enable the mouse
set -g mouse on
# Toggle the mouse
#bind m run "cut -c3- ~/.tmux.conf | sh -s _toggle_mouse"
### Capture the tmux version for version specific options ###
# See: https://github.com/tmux/tmux/blob/master/CHANGES
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6- | tr -d \"[:alpha:]\")"
### Start new panes in the current pane's directory ###
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
#### Disable key repeat ####
# Disable repeat for changing panes (by rebinding shortcuts without the -r option)
bind-key Up select-pane -U
bind-key Down select-pane -D
bind-key Left select-pane -L
bind-key Right select-pane -R
# Keep tmux from repeating keys
set-option -g repeat-time 0
#### VI Mode ####
# Make copying text more like vim by using 'v' and 'y'
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.4" | bc)" = 1 ]' \
"bind-key -t vi-copy 'v' begin-selection; \
bind-key -t vi-copy 'y' copy-selection"
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \
"bind-key -T copy-mode-vi 'v' send -X begin-selection; \
bind-key -T copy-mode-vi 'y' send -X copy-selection; \
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle"
# Use vi-like key bindings
set-window-option -g mode-keys vi
#### Navigate panes using vim-like shortcuts (hjkl) ####
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
# emacs key bindings in tmux command prompt (prefix + :) are better than
# vi keys, even for vim users
set -g status-keys emacs
# clock
set-window-option -g clock-mode-colour green #green
# bell
set-window-option -g window-status-bell-style fg=black,bg=red #base02, red
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'egel/tmux-gruvbox'
set -g @plugin 'tmux-plugins/tmux-logging'
#set -g @tmux-gruvbox 'dark' # or 'light'
# color (Solarized dark)
# set -g @plugin 'seebi/tmux-colors-solarized'
# set -g @colors-solarized 'dark'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'