-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
49 lines (37 loc) · 1.31 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
## Keybindings
unbind C-a
unbind C-b
#Prefix is Ctrl-a
set-option -g prefix C-a
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
# Renumber if closed
set -g renumber-windows on
# use UTF8
set -g utf8
set-window-option -g utf8 on
set-option -g status-utf8 on
# make tmux display things in 256 colors
set -g default-terminal screen-256color
# set scrollback history to 10000 (10k)
set -g history-limit 10000
# Vim keybinds
set-option -g status-keys vi
set-window-option -g mode-keys vi
# Quick scrollback viewing with shift-pgup/dn
bind -n S-PageUp copy-mode -u
# Fix S-pgup/dn
set -g terminal-overrides '*rxvt*:smcup@:rmcup@'
# Theme
# If we connected over SSH, no powerline symbols
if-shell 'test -n "$SSH_TTY"' 'source ~/dotfiles/tmux/tmuxline-snapshot-ssh'
# If not SSH, do use them
if-shell 'test -z "$SSH_TTY"' 'source ~/dotfiles/tmux/tmuxline-snapshot'
# 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"