-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
34 lines (23 loc) · 1.52 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
set -g default-terminal "xterm-256color"
set-option -g prefix C-b
set-option -g prefix2 `
setw -g mode-keys vi
# bind-key -t vi-copy Enter copy-pipe "nc -U ~/.clipper.sock"
bind-key y run-shell "zsh -c 'tmux save-buffer - | nc -U ~/.clipper.sock'" \; display-message "sent to clipboard!"
bind-key v split-window -h
bind-key h split-window -v
bind r source-file ~/.tmux.conf
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '\#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '\#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '\#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '\#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
# NOTE: We must escape the backslash as otherwise we print {pane_current_command}
# literally which is undesired. It is still unclear why this only affected C-j and
# not the other bindings.
# https://stackoverflow.com/questions/8483798/tmux-borders-displayed-as-x-q-instead-of-lines
set-option -ga terminal-overrides ',*:enacs@:smacs@:rmacs@:acsc@'
bind-key ` send-keys `
set-option -g history-limit 10000
# Version-specific configuration can be placed in ~/.tmux/${TMUX_VERSION}/*.conf
run-shell "for conf in ~/.tmux/$(tmux -V | cut -d' ' -f2)/.tmux.conf; do tmux source-file \"\$conf\"; done"