-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
106 lines (80 loc) · 3.27 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# remap prefix to Control + a, like screen
# and also to Control + s, for conflicts
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# act like vim
bind -r k resize-pane -U 5
bind -r h resize-pane -L 5
bind -r j resize-pane -D 5
bind -r l resize-pane -R 5
# focus pane (this toggles)
bind Up resize-pane -Z
setw -g mode-keys vi
set -g status-keys emacs
set -g default-shell $SHELL
# Setup 'v' to begin selection as in Vim
bind -T copy-mode-vi 'v' send -X begin-selection
# Jump back to the prompt after yanking
bind -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind -T copy-mode-vi Escape send -X cancel
set -g default-command "reattach-to-user-namespace -l zsh"
# If running in Terminal.app, use reattach-to-user-namespace hack
if '[ $TERM_PROGRAM = Apple_Terminal ]' \
'bind -T copy-mode-vi "y" send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"'
# mouse things
set -g mouse on
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# bind key for synchronizing panes
bind-key e set-window-option synchronize-panes
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# New named window
bind N command-prompt -p name: "new-window -n '%1'"
set -g history-limit 10000
# look better
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# Titles (window number, program name, active (or not)
set -g set-titles on
set -g set-titles-string '#S.#I.#P #W'
# New windows/pane in $PWD
bind c new-window -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# splits from https://github.com/tmux-plugins/tmux-pain-control
bind "|" split-window -h -c "#{pane_current_path}"
bind "\\" split-window -fh -c "#{pane_current_path}"
bind "-" split-window -v -c "#{pane_current_path}"
bind "_" split-window -fv -c "#{pane_current_path}"
bind "%" split-window -h -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"
# other craziness
set -g mode-style fg=colour50
set -g status-fg colour137
set -g status-bg colour237
setw -g window-status-current-format '#[fg=colour81,bg=colour238] #I#[fg=colour250] #[fg=colour255]#W#[fg=colour81]#F '
# molokai
# setw -g window-status-bg colour23k
# seoul256
setw -g window-status-format '#[fg=colour138,bg=colour237] #I #[fg=colour250]#W#[fg=colour244]#F '
set -g status-interval 5
set -g status-justify left
set -g status-left ''
set -g status-right '#[fg=colour215]#S #[fg=colour249,bg=colour240] %m/%d #[fg=colour240,bg=colour249] %H:%M '
set -g status-right-length 50
set -g status-left-length 20
set -g visual-activity on
# Local config
if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'