-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
37 lines (28 loc) · 1.38 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
# This enables the open command to keep working.
# Explanation here:
# https://apple.stackexchange.com/questions/243067/terminal-app-and-tmux-session-cant-use-open-command-without-tmux-it-works
#set -g default-command "safe-reattach-to-user-namespace -l ${SHELL}"
if-shell -b '[ -n "$(command -v reattach-to-user-namespace)" ]' \
" \
set-option -g default-command 'reattach-to-user-namespace -l ${SHELL}'; \
"
set -g default-terminal "screen-256color"
set-window-option -g xterm-keys on
# For working with vim, from https://www.bugsnag.com/blog/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"
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# nvim requires these.
set-option -sg escape-time 10
set-option -g focus-events on
set-option -sa terminal-overrides ',xterm-256color:Tc'
# Let's try ctrl-space as the prefix:
#unbind-key C-b
#set-option -g prefix C-Space
#bind-key C-Space send-prefix