-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
64 lines (52 loc) · 2.32 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
set-option -g prefix C-SPACE
set-window-option -g xterm-keys on # add C-arrow word jumping
set -g default-terminal "screen-256color-bce"
set -g base-index 1
set -s escape-time 0 # prevent esc from lagging
set-option -g mouse on
# set-option -ga terminal-overrides ',rxvt-unicode-256color:Tc'
set-window-option -g mode-keys vi
set -g status-keys vi
set-window-option -g automatic-rename on
set-option -g set-titles on
bind-key v split-window -c '#{pane_current_path}' -h
bind-key s split-window -c '#{pane_current_path}' -v
# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Make copy mode more vimlike
# unbind-key -t copy-mode-vi v
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# leader -> space displays the current working directory (useful when you forget in vim)
bind-key M-Space display-message '#{pane_current_path}'
# Reload tmux config
bind r source-file ~/.tmux.conf \; display-message "source-file done"
# THEME
set -g status-bg black
set -g status-fg white
set -g window-status-current-bg white
set -g window-status-current-fg black
set -g window-status-current-attr bold
set -g status-interval 60
set -g status-left-length 30
set -g status-left '#[fg=green](#S) #(whoami) '
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]#(acpi -b | cut -d"," -f2)'
# Use Alt-vim keys without prefix key to switch panes
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -Pc '\\bn?vim?(diff)?\\b'"
bind-key -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
bind-key -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
bind-key -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
bind-key -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
bind-key -n M-\ if-shell "$is_vim" "send-keys M-\\" "select-pane -l"
bind-key -T copy-mode-vi M-h select-pane -L
bind-key -T copy-mode-vi M-j select-pane -D
bind-key -T copy-mode-vi M-k select-pane -U
bind-key -T copy-mode-vi M-l select-pane -R
bind-key -T copy-mode-vi M-\ select-pane -l
# neovim cursor change support (nvim > 0.2)
set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'