dotfiles/cli/tmux/tmux.conf

99 lines
3.1 KiB
Plaintext
Raw Normal View History

2020-04-27 06:47:36 +00:00
############################
# general
############################
# set -g set-clipboard on # rely on xterm sequence
2022-07-30 02:25:24 +00:00
set -g default-terminal "screen-256color"
2020-04-27 06:47:36 +00:00
set -s escape-time 0
set -g base-index 1
set -g pane-base-index 1
2020-11-18 03:52:54 +00:00
set-option -g mouse on
2020-04-27 06:47:36 +00:00
#set-option -g mouse-select-pane on
set-option -g display-time 4000
2021-03-25 03:54:17 +00:00
set-option -g set-titles on
set-option -g set-titles-string "#S / #W"
2020-04-27 06:47:36 +00:00
############################
# keybindings
############################
setw -g mode-keys vi
set -g status-keys vi
2021-09-20 13:56:19 +00:00
set -g default-shell $TMUX_SHELL
2020-05-24 09:34:16 +00:00
# set -g prefix C-h
bind c new-window -c '#{pane_current_path}'
bind '"' split-window -c '#{pane_current_path}'
bind % split-window -h -c '#{pane_current_path}'
2020-04-27 06:47:36 +00:00
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind a set-window-option automatic-rename
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
bind m \
set-option -g mouse on \;\
display 'Mouse: ON'
# set mouse off with prefix M
bind M \
set-option -g mouse off \;\
display 'Mouse: OFF'
2020-04-27 06:47:36 +00:00
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
2020-09-21 06:43:40 +00:00
bind -n M-H resize-pane -L 10
2020-04-27 06:47:36 +00:00
bind -n M-J resize-pane -D 10
bind -n M-K resize-pane -U 10
2020-09-21 06:43:40 +00:00
bind -n M-L resize-pane -R 10
2020-04-27 06:47:36 +00:00
bind -n M-0 select-window -t :=0
bind -n M-1 select-window -t :=1
bind -n M-2 select-window -t :=2
bind -n M-3 select-window -t :=3
bind -n M-4 select-window -t :=4
bind -n M-5 select-window -t :=5
bind -n M-6 select-window -t :=6
bind -n M-7 select-window -t :=7
bind -n M-8 select-window -t :=8
bind -n M-9 select-window -t :=9
bind -n M-n next-window
bind -n M-p previous-window
2020-05-17 08:58:08 +00:00
bind -n M-N swap-window -t +1 \; next-window
bind -n M-P swap-window -t -1 \; previous-window
2020-04-27 06:47:36 +00:00
bind -n M-[ copy-mode
bind -n M-] paste-buffer
############################
# plugins
############################
set -g @yank_action 'copy-pipe'
set -g @plugin 'tmux-plugins/tmux-yank'
2020-09-21 06:43:40 +00:00
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone --depth 1 https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# prefix + I
# plugins dir: ~/.tmux/plugins/
2020-04-27 06:47:36 +00:00
run -b '~/.tmux/plugins/tpm/tpm'
############################
# appearance
############################
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6- | sed 's/[a-z]//g')"
if-shell -b '[ "$(echo "$TMUX_VERSION > 2.8" | bc)" = 1 ]' \
"source ~/.config/tmux/tmux2.9.conf" \
"source ~/.config/tmux/tmux2.8.conf"
# statusbar
set -g status-left "#[bg=colour4,fg=colour7] #S #[bg=default]"
set -g automatic-rename on
set -g automatic-rename-format '#{b:pane_current_path}'
set -g window-status-format ' #I:#W#F '
set -g window-status-current-format ' #I:#W#F '
set -g window-status-separator ""
set -g window-status-current-style "bg=black,fg=white"
set -g status-interval 5
#set -g status-right-length 80
2020-04-27 06:47:36 +00:00
#set -g status-right '#[fg=white,bg=red] prefix: C-h #[fg=black,bg=colour14,bold]#{simple_git_status}#[fg=colour14,bg=black] #(echo $USER)@#H #[fg=colour7,bg=colour4] %Y-%m-%d %H:%M '
set -g status-right '#[fg=white] #(echo $USER)@#H '
set -g status-right-length 30