-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
76 lines (58 loc) · 2.28 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
# switch default Ctrl+b prefix to Ctrl+a
unbind C-b
set -g prefix C-a
# keep colors
set -g default-terminal "rxvt-unicode-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
# bind tmux configuration reload to r
unbind r
bind r source-file $HOME/.tmux.conf \; display "Tmux configuration ${HOME}/.tmux.conf reloaded"
# unbind vertical and horizontal split and set to | -, respectively
unbind %
unbind "'"
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# vim motions for pane navigation: Ctrl+[hjkl] (no prefix needed)
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R
# vim motions for window navigation: Ctrl+[hl]
bind h previous-window
bind l next-window
# set window to 1-indexing
set -g base-index 1
set-window-option -g pane-base-index 1
# increase the history limit: useful when reading logs
set -g history-limit 100000
# set vim motions as default
set-window-option -g mode-keys vi
# configure copy mode to use vim defaults
unbind -T copy-mode-vi Space
unbind -T copy-mode-vi Enter
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
# 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 -iqE '^[^TXZ ]+ +(\\S+\\/)?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"
## COLORS ##
# pane border
set -g pane-border-style fg="#6272a4"
set -g pane-active-border-style fg="#403d52"
# status line
set -g status-style bg="#191724",fg="#e0def4"
set -g status-interval 1
# message
set -g message-style bg="#403d52",fg="#e0def4"
# window status
set-window-option -g window-status-style fg='#403d52',bg=default
set-window-option -g window-status-current-style fg='#f6c177',bg='#282a36'
# hide status-right
set -g status-right-length 100
set -g status-right '#(pwd)'