-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
57 lines (46 loc) · 1.58 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
# Set TERM to enable 256 color support
set -g default-terminal "screen-256color"
set -sa terminal-overrides ",*-256color*:RGB"
# Set default shell to zsh
set -g default-shell /bin/zsh
# Enable mouse support
set -g mouse on
# Change prefix to Ctrl-Space
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Longer scrollback
set -g history-limit 10000
# Better numbering
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# Enable copy vi mode
setw -g mode-keys vi
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# Better window commands
unbind '"'
unbind %
bind b new-session
bind c new-window -c "#{pane_current_path}"
bind x split-window -vc "#{pane_current_path}"
bind v split-window -hc "#{pane_current_path}"
bind C-Space last-window
bind C-l send-keys 'C-l'
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(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 -T copy-mode-vi 'C-h' select-pane -L
bind -T copy-mode-vi 'C-j' select-pane -D
bind -T copy-mode-vi 'C-k' select-pane -U
bind -T copy-mode-vi 'C-l' select-pane -R