-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf.symlink
118 lines (89 loc) · 3.79 KB
/
tmux.conf.symlink
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# --------------#
# tmux-sensible #
# --------------#
# https://github.com/tmux-plugins/tmux-sensible
# address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0
# increase scrollback buffer size
set -g history-limit 50000
# tmux messages are displayed for 4 seconds
set -g display-time 4000
# refresh 'status-left' and 'status-right' more often
set -g status-interval 5
# upgrade $TERM
set -g default-terminal "screen-256color"
# emacs key bindings in tmux command prompt (prefix + :) are better than
# vi keys, even for vim users
set -g status-keys emacs
# focus events enabled for terminals that support them
set -g focus-events on
# super useful when using "grouped sessions" and multi-monitor setup
setw -g aggressive-resize on
# --------#
# General #
# --------#
# Default shell
set -g default-shell $SHELL
# Mouse
# set -g mouse on
## Turn off mouse so everything works using terminal on remote machines
set -g mouse off
# Set windows and page index to base 1
set -g base-index 1
setw -g pane-base-index 1
# Re-number windows when creating/closing new windows
set -g renumber-windows on
# Use vim key bindings in copy mode
setw -g mode-keys vi
# Fix ESC delay in vim
# set -g escape-time 10
# ------------#
# Keybindings #
# ------------#
# Copy-mode
# Enter copy mode using CTRL-B 'Esc'
unbind [
bind Escape copy-mode
unbind-key -T copy-mode-vi v
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi 'C-v' send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# Send command on double press
bind C-a send-prefix
bind C-l send-keys 'C-l'
# Reload tmux.conf on prefix r
bind r source-file ~/.tmux.conf \; display "Config reloaded!"
# Split panes and remember current path
# bind '\' split-window -h -c '#{pane_current_path}'
bind 'ö' split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
# Remember current path when creating new windows
bind c new-window -c '#{pane_current_path}'
# Break pane into new window and keep focus on the current window
bind b break-pane -d
# Smart pane switching with awareness of Vim splits.
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-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# -----------#
# Status bar #
# -----------#
set-option -g status-justify left
set-option -g status-left '#[bg=colour72] #[bg=colour237] #[bg=colour236] #[bg=colour235]#[fg=colour185] #S #[bg=colour236] '
set-option -g status-left-length 16
set-option -g status-bg colour237
set-option -g status-right '#[bg=colour235]#[fg=colour185] #H #[bg=colour236] #[bg=colour235]#[fg=colour185] %a %R #[bg=colour236]#[fg=colour3] #[bg=colour237] #[bg=colour72] #[]'
set-option -g pane-active-border-style fg=colour246
set-option -g pane-border-style fg=colour238
set-window-option -g window-status-format '#[bg=colour238]#[fg=colour107] #I #[bg=colour239]#[fg=colour110] #[bg=colour240]#W#[bg=colour239]#[fg=colour195]#F#[bg=colour238] '
set-window-option -g window-status-current-format '#[bg=colour236]#[fg=colour215] #I #[bg=colour235]#[fg=colour167] #[bg=colour234]#W#[bg=colour235]#[fg=colour195]#F#[bg=colour236] '