-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
134 lines (99 loc) · 3.95 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# non login shell
set -g default-command "${SHELL}"
# default terminal
set -g default-terminal $TERM
set-option -ga terminal-overrides ',$TERM:Tc'
set-option -sa terminal-overrides ',$TERM:RGB'
# remap prefix
unbind C-b
set -g prefix M-a
# remap copy-mode
unbind [
bind Escape copy-mode
# remap p
unbind p
bind p paste-buffer
# mouse mode
set -g mouse on
# disable clipboard
set -s set-clipboard off
# start window numbers at 1 to match keyboard order with tmux window order
# renumber windows sequentially after closing any of them
set -g base-index 1
set-window-option -g pane-base-index 1
set -g renumber-windows on
# increase scrollback lines
set -g history-limit 99999
# clear console
bind C-l send-keys 'C-l'
# act like vim
setw -g mode-keys vi
# command-prompt
bind : command-prompt
# toogle status
bind Q set -g status
# window navigation
bind space next-window
bind bspace previous-window
# window rotation
bind C-o rotate-window
# split window
bind % split-window -v -c "#{pane_current_path}"
bind ! split-window -h -c "#{pane_current_path}"
# fire new window at current path
bind c new-window -c "#{pane_current_path}"
# break pane
bind b break-pane -d
# swap panes
bind > swap-pane -D
bind < swap-pane -U
# edit/source tmux.conf
bind -T multiEditBindings T new-window -n '.tmux.conf' 'nvim ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display "Sourced ~/.tmux.conf"'
bind -T multiReloadBindings T source-file ~/.tmux.conf \; display-message "Sourced ~/.tmux.conf"
# edit/soure zshrc
bind -T multiEditBindings Z new-window -n '.zshrc' 'nvim ~/$ZDOTDIR/.zshrc && source ~/$ZDOTDIR/.zshrc && tmux display "Sourced ~/$ZDOTDIR/.zshrc"'
bind -T multiReloadBindings Z source-file ~/$ZDOTDIR/.zshrc \; display-message "Sourced ~/$ZDOTDIR/.zshrc"
# edit vimrc
bind -T multiEditBindings V new-window -n '.vimrc' 'nvim ~/.vimrc'
# edit init.vim
bind -T multiEditBindings N new-window -n 'init.vim' 'nvim ~/.config/nvim/init.vim'
# edit/reload multi bindings
bind E switch-client -T multiEditBindings
bind R switch-client -T multiReloadBindings
# edit todo
bind T split-window -h -c ~/ 'nvim ~/.todo/todo.txt'
# launch htop
bind H split-window -h 'htop'
# panes fine adjustment (1 or 2 cursor cells per bump)
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 1
bind -n S-Up resize-pane -U 1
# panes coarse adjustment (5 or 10 cursor cells per bump)
bind -n M-Left resize-pane -L 10
bind -n M-Right resize-pane -R 10
bind -n M-Down resize-pane -D 5
bind -n M-Up resize-pane -U 5
# bind home end and backsapce keys
bind-key -n Home send Escape "OH"
bind-key -n End send Escape "OF"
bind-key -n BSpace send "^H"
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'sainnhe/tmux-fzf'
set -g status-justify 'centre'
set -g status-left-length '100'
set -g status 'on'
set -g status-right-length '100'
setw -g window-status-separator ''
set -g status-bg black
set -g status-left '#[fg=black,bg=red] #S #[fg=red,bg=blue,nobold,nounderscore,noitalics]#[fg=black,bg=blue] #(whoami) #[fg=blue,bg=black,nobold,nounderscore,noitalics]#[fg=black,bg=black,nobold,nounderscore,noitalics]'
set -g status-right '#[fg=black,bg=black,nobold,nounderscore,noitalics]#[fg=blue,bg=black,nobold,nounderscore,noitalics]#[fg=black,bg=blue] #H #[fg=red,bg=blue,nobold,nounderscore,noitalics]#[fg=black,bg=red] #(uptime|cut -f 4-5 -d " " | cut -f 1 -d ",") '
setw -g window-status-format '#[fg=white, bg=black] #I:#W '
setw -g window-status-current-format '#[fg=black,bg=red] #I:#W#F '
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'