-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
68 lines (47 loc) · 1.8 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
#this remaps ctrl b to ctrl-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
set-window-option -g pane-base-index 1
#Set status bar on top
set-option -g status-position top
#mouse scrolling
set -g mouse on
#this remaps spil from | and -
unbind %
bind h split-window -v
bind v split-window -h
#refresh tmux with prefix+r
bind r source ~/.tmux.conf\; display "~/.tmux.conf sourced!"
#Toggle status bar
bind / set -g status
set -g status off
#this gets rid of the screen cropping thing
setw -g aggressive-resize on
set -g default-terminal screen-256color
# Highlight active window
set-window-option -g window-status-current-bg red
# Start numbering at 1
set -g base-index 1
# Allows for faster key repetition
set -s escape-time 0
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on
# auto window rename
set-window-option -g automatic-rename
# 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"
# https://blog.bugsnag.com/tmux-and-vim/
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"