summaryrefslogtreecommitdiff
path: root/dotfiles/system/.tmux.conf
blob: ea3bc0d3008f24fcb874c1a5ccbebaa224d33c29 (plain)
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
# note: refresh the list of plugins =  prefix + capital I 

# enable mouse support
set -g mouse on

# enabling passthrough for kitty image rendering
set -g allow-passthrough on

# make scrolling with wheels work
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M

# list of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-logging'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'MunifTanjim/tmux-mode-indicator'  
set -g @plugin 'MunifTanjim/tmux-suspend'
set-option -g @plugin 'b0o/tmux-autoreload'

# yank to the clipboard when selecting with the mouse
set -g @yank_selection_mouse 'clipboard'

# plugin Settings
set -g @mighty-scroll-interval 3
set -g @mighty-scroll-by-line 'man fzf'
set -g @mighty-scroll-select-pane off 

# put tmux mode indicator on right  
set -g status-right '%Y-%m-%d %H:%M #{tmux_mode_indicator}'
    
# gruvbox compatible colours
set -g status-fg colour0
set -g status-bg colour15

# number the panes and match keyboard order
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on  

# address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0

# tmux messages are displayed for 4 seconds
set -g display-time 4000

# upgrade $TERM
set -g default-terminal "screen-256color"
  
# prefix r reloads config
bind r source-file ~/.tmux.conf \; display "tmux config reloaded"

# keep path with new window  
bind c new-window -c "#{pane_current_path}"

# split window horizontally  
bind-key "|" split-window -h -c "#{pane_current_path}"
bind-key "\\" split-window -fh -c "#{pane_current_path}"

# split window vertically  
bind-key "-" split-window -v -c "#{pane_current_path}"
bind-key "_" split-window -fv -c "#{pane_current_path}"

# easier and faster switching between next/prev window
bind C-p previous-window
bind C-n next-window    

# prefix shift + W moves to last window
# note:  prefix shift S moves to last session with sessionist plugin
bind W last-window

# increase scrollback buffer  
set-option -g history-limit 50000

# don't allow suspending client
unbind-key C-z

# emacs key bindings in tmux command prompt (prefix + :) 
set -g status-keys emacs  

# install tmux plugins automatically when tmux is started  
if "test ! -d ~/.tmux/plugins/tpm" \
   "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
  
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'