-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
74 lines (60 loc) · 2.07 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
# general settings
setenv -g PATH "/usr/local/bin:$PATH"
setenv -g PATH "/opt/homebrew/bin:$PATH"
set -g default-shell $SHELL
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
set -g history-limit 100000
set -s escape-time 0
# window numbering
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
set -g automatic-rename on
# mouse
set -g mouse on
# reload tmux.conf
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# act like Vim
setw -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# main window at the top, splits at the bottom
bind = select-layout main-horizontal\; run "tmux resize-pane -t1 -y$((#{window_height} * 2/3))"
# keep pwd when splitting and creating new windows
bind c new-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
# force kill pane
bind X confirm-before -p "force-kill pane #{pane_index}? (y/n)" "run-shell 'kill -9 #{pane_pid}'"
# make original C-hjkl available through prefix
bind -r C-h send-keys C-h
bind -r C-j send-keys C-j
bind -r C-k send-keys C-k
bind -r C-l send-keys C-l
# window resizing
bind -r h resize-pane -L
bind -r j resize-pane -D
bind -r k resize-pane -U
bind -r l resize-pane -R
# colors
set -g pane-border-style "fg=colour235"
set -g pane-active-border-style "fg=colour1"
set -g status-style "fg=colour8"
set -g window-status-current-style "fg=colour4"
# status line
set -g status-position bottom
set -g status-left ' #S │'
set -g status-right '#(date +"%a %d %b %H:%M") '
set -g status-justify left
set -g window-status-format ' #I·#W'
set -g window-status-current-format ' #I·#W'
# plugins
set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
run -b '~/.tmux/plugins/tpm/tpm'
# local config
if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'
# create new session if none exists
if-shell "[[ -z $(tmux list-sessions) ]]" new-session