-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtmux.conf
92 lines (74 loc) · 3.02 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# ----------------------
# General Settings
# ----------------------
set-option -g default-shell /bin/zsh
set-option -g default-command "reattach-to-user-namespace -l zsh" # Fix OSX pasteboard issue
unbind C-b
set-option -g prefix C-a # Remap prefix to ctrl-a
set -g focus-events on # Capture focus events
set -g renumber-windows on # Automatically renumber windows
set -g base-index 1 # Start window numbering at 1
set -g display-time 2000 # tmux messages are displayed for 2 seconds
set -g history-limit 100000 # increase scrollback buffer size
set -g status-interval 5 # refresh 'status-left' and 'status-right' more often
# Vi options
set-window-option -g mode-keys vi # Enable vi mode
set -s escape-time 0 # Fix vi mode switching delay
# Set parent terminal title to reflect current window in tmux session
set -g set-titles on
set -g set-titles-string "#I:#W [#P:#{pane_current_command}]"
# ----------------------
# Shortcuts
# ----------------------
bind | split-window -h
bind - split-window -v
bind r source-file ~/.tmux.conf \; display "Reloaded tmux.conf"
# bind C-(number) to select window without having to use prefix
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
# ----------------------
# Mouse mode
# ----------------------
set -g mouse on
# Start copy mode when scrolling up and exit when scrolling down to bottom.
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# ----------------------
# UI
# ----------------------
if-shell "[[ $ITERM_PROFILE == 'dark' ]]" "source-file ~/.tmux/tmuxline-dark.conf"
if-shell "[[ $ITERM_PROFILE == 'light' ]]" "source-file ~/.tmux/tmuxline-light.conf"
# ----------------------
# Keyboard Layout
# ----------------------
set -g update-environment "KEYBOARD_LAYOUT"
is_workman='[[ $KEYBOARD_LAYOUT == "workman" ]]'
is_qwerty='[[ $KEYBOARD_LAYOUT == "qwerty" ]]'
if-shell "$is_workman" "unbind h"
if-shell "$is_workman" "unbind j"
if-shell "$is_workman" "unbind k"
if-shell "$is_workman" "unbind l"
if-shell "$is_workman" "bind y select-pane -L"
if-shell "$is_workman" "bind n select-pane -D"
if-shell "$is_workman" "bind e select-pane -U"
if-shell "$is_workman" "bind o select-pane -R"
if-shell "$is_qwerty" "unbind y"
if-shell "$is_qwerty" "unbind n "
if-shell "$is_qwerty" "unbind e "
if-shell "$is_qwerty" "unbind o "
if-shell "$is_qwerty" "bind h select-pane -L "
if-shell "$is_qwerty" "bind j select-pane -D "
if-shell "$is_qwerty" "bind k select-pane -U "
if-shell "$is_qwerty" "bind l select-pane -R"
## ----------------------
## Copy + Paste
## ----------------------
#bind-key -Tcopy-mode-vi 'v' send -X begin-selection
#bind-key -Tcopy-mode-vi 'y' send -X copy-selection