-
Notifications
You must be signed in to change notification settings - Fork 3
/
.tmux.conf
54 lines (40 loc) · 1.78 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
# Set elvish system wide
#set-option -g default-shell "/usr/local/bin/elvish"
# Fix clipboard on osx
if-shell 'test "$(uname -s)" = Darwin' 'set-option -g default-command "exec reattach-to-user-namespace -l elvish"'
# Fix vim colorscheme
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# Start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
# Renumber windows sequentially after closing any of them
set -g renumber-windows on
# Increase scrollback lines
set -g history-limit 10000
# Enable mouse support (works in iTerm)
set-option -g -q mouse on
# Smart pane switching with awareness of vim splits
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Enable vi-like bindings for navigating a buffer
set-window-option -g mode-keys vi
# New window with default path set to last path
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Starts selection
bind-key -t vi-copy 'v' begin-selection
# Copy selection
bind-key -t vi-copy 'y' copy-selection
# Bind <prefix> C-l to clear the screen.
bind C-l send-keys 'C-l'
# Reload ~/.tmux.conf
bind 'r' source-file ~/.tmux.conf \; display "~/.tmux.conf reloaded!"
# Tmuxline configuration
if-shell "test -f ~/.tmuxline" "source ~/.tmuxline"