-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
88 lines (71 loc) · 3.48 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
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
set -g base-index 1 # start indexing windows at 1 instead of 0
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set -g detach-on-destroy off # don't exit from tmux when closing a session
set -g escape-time 0 # zero-out escape time delay
set -g history-limit 1000000 # increase history size (from 2,000)
set -g mouse on # enable mouse support
set -g renumber-windows on # renumber all windows when any window is closed
set -g set-clipboard on # use system clipboard
set -g status-interval 3 # update the status bar every 3 seconds
set-window-option -g mode-keys vi
unbind C-b
set -g prefix C-s
bind C-s send-prefix
unbind %
bind q split-window -h -c "#{pane_current_path}"
unbind '"'
bind v split-window -v -c "#{pane_current_path}"
bind c new-window -c '#{pane_current_path}'
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
# resizing
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'resize-pane -L 1'
bind -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'resize-pane -D 1'
bind -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'resize-pane -U 1'
bind -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'resize-pane -R 1'
bind-key -T copy-mode-vi M-h resize-pane -L 1
bind-key -T copy-mode-vi M-j resize-pane -D 1
bind-key -T copy-mode-vi M-k resize-pane -U 1
bind-key -T copy-mode-vi M-l resize-pane -R 1
set-window-option -g mode-keys vi
bind-key x kill-pane # skip "kill-pane 1? (y/n)" prompt (cmd+w)
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
#--------------------------------------------------------------------------
# Status line
#--------------------------------------------------------------------------
# Status line customisation
set-option -g status-left-length 100
# set-option -g status-right-length 100
set-option -g status-left " #{session_name} "
set-option -g status-right " "
# set-option -g status-style "fg=#7C7D83 bg=#18242e" # ayu
# set-option -g status-style "fg=#7C7D83 bg=#16151d" # tokyo night
# set-option -g status-style "fg=#7C7D83 bg=#24282f" # one dark
set-option -g status-style "fg=#7C7D83 bg=default" # gruvbox dark
# set-option -g status-style "fg=#828bb1 bg=default" # default will set the background to transparent
set-option -g window-status-format "#{window_index}:#{window_name}#{window_flags} " # window_name -> pane_current_command
set-option -g window-status-current-format "#{window_index}:#{window_name}#{window_flags} "
set-option -g window-status-current-style "fg=#dcc7a0" #for gruvbox use: dcc7a0 or aeb6ff
set-option -g window-status-activity-style none
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# NEEDS TO BE AT THE BOTTOM
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'