-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
124 lines (95 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
# Create a new ssh prompt which will open in a new window
bind S command-prompt -p ssh: "new-window -n '^ %2' 'ssh %1'"
# Create a new named window
bind N command-prompt -p name: "new-window -n '%1'"
# Setting the prefix from C-b to C-a
unbind C-b
set -g prefix C-a
set -g base-index 1
setw -g pane-base-index 1
set -g default-terminal 'screen-256color'
set -ga terminal-overrides ',xterm-256color:Tc'
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# splitting panes
bind t split-window -p 15
bind T split-window -h -p 33
bind E split-window -h -l 80
# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on
# set the status line's colors
set -g status-style fg=white,bg=black
# set the color of the window list
setw -g window-status-style fg=cyan,bg=default,dim
# set colors for the active window
setw -g window-status-current-style fg=white,bg=red,bright
# Command / message line colors
set -g message-style fg=white,bg=black,bright
# Status line left side
set -g status-left-length 8
set -g status-left "#[fg=green]S:#S"
# Center the window list
set -g status-justify centre
# enable vi keys.
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
# Quick pane selection
bind -r C-p select-window -t :-
bind -r C-n select-window -t :+
set -g mouse on
# focus pane (this toggles)
bind Up resize-pane -Z
# Make Vim responsive to esc
set -s escape-time 2
# NOTES
# -----
# prefix space will toggle layouts
# prefix { will swap panes
# prefix C-o will swap panes too it seems
# break-pane
bind-key b break-pane
# join-pane
bind-key Enter command-prompt "joinp -t:%%" # %% = prompt for window.pane [-V|H] # vert|hor split
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n 'C-h' if-shell "$is_vim" "send-keys 'C-h'" "select-pane -L"
bind -n 'C-j' if-shell "$is_vim" "send-keys 'C-j'" "select-pane -D"
bind -n 'C-k' if-shell "$is_vim" "send-keys 'C-k'" "select-pane -U"
bind -n 'C-l' if-shell "$is_vim" "send-keys 'C-l'" "select-pane -R"
bind -n 'C-\' if-shell "$is_vim" "send-keys 'C-\\'" "select-pane -l"
# Only source the tmux_mac config if we're on macOS
if-shell 'test "$(uname)" = "Darwin"' 'source ${HOME}/.tmux_mac.conf'
if-shell 'test "$(uname)" = "Linux"' 'source ${HOME}/.tmux_linux.conf'
# List of plugins
# Supports `github_username/repo` or full git repo URLs
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-copycat \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-open \
tmux-plugins/tmux-pain-control \
tmux-plugins/vim-tmux-focus-events \
nhdaly/tmux-better-mouse-mode \
'
# Other examples:
# github_username/plugin_name \
# [email protected]/user/plugin \
# [email protected]/user/plugin \
setenv -g TMUX_PLUGIN_MANAGER_PATH "$HOME/.tmux/plugins/"
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && \
~/.tmux/plugins/tpm/bin/install_plugins'"
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell '~/.tmux/plugins/tpm/tpm'
# A few lines above this it says to keep the run-shell command "at the very
# bottom of this file", which is great if you want everything in tmux-sensible,
# but for some reason my display-time wasn't being honored when defined above,
# so just put it below to manually override tpm/tmux-sensible.
# timeout
set -g display-time 750
# allow clearing of screen in a shell
bind C-l send-keys 'C-l'