-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.tmux.conf
103 lines (77 loc) · 3 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
# Old habits die hard, so map prefix to Control + a, like Screen
set -g prefix C-a
bind C-a send-prefix
# show status of each pane
set -g pane-border-format "#{pane_index} #{pane_title}"
set -g pane-border-status bottom
bind -n C-k clear-history
# 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
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
bind -T copy-mode-vi "y" send -X copy-pipe-and-cancel "pbcopy"
# mouse things
set -g mouse on
# Split vertically using pipe, horizontally using dash
bind | split-window -h
bind - split-window -v
# control-k clears scrollback
bind -n C-k clear-history
# 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"
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
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}"
# open splits vi style
bind v split-window -h -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
# other craziness
set -g pane-active-border-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'