114 lines
2.9 KiB
Bash
114 lines
2.9 KiB
Bash
### Terminal
|
|
|
|
set-option -g default-shell "$SHELL"
|
|
set -g default-terminal "tmux-256color"
|
|
|
|
# enable true color terminal
|
|
set -ga terminal-overrides ",*256col*:Tc,alacritty:Tc"
|
|
|
|
# enable hyperlinks
|
|
set -as terminal-features ",*:hyperlinks"
|
|
|
|
### Keybinds
|
|
|
|
# new panes (open with current path)
|
|
bind-key -n M-v split-window -h -c "#{pane_current_path}"
|
|
bind-key -n M-s split-window -v -c "#{pane_current_path}"
|
|
|
|
# new windows
|
|
bind-key -n M-c new-window -c "#{pane_current_path}"
|
|
|
|
# vi-style pane selection
|
|
bind-key -n M-h select-pane -L
|
|
bind-key -n M-j select-pane -D
|
|
bind-key -n M-k select-pane -U
|
|
bind-key -n M-l select-pane -R
|
|
|
|
# pane zoom
|
|
bind-key -n M-z resize-pane -Z
|
|
|
|
# window rename
|
|
bind-key -n M-, command-prompt -p "Rename tab:" "rename-window '%%'"
|
|
bind-key -n M-< set automatic-rename on
|
|
|
|
# navigate windows
|
|
bind-key -n M-1 select-window -t 1
|
|
bind-key -n M-2 select-window -t 2
|
|
bind-key -n M-3 select-window -t 3
|
|
bind-key -n M-4 select-window -t 4
|
|
bind-key -n M-5 select-window -t 5
|
|
bind-key -n M-6 select-window -t 6
|
|
bind-key -n M-7 select-window -t 7
|
|
bind-key -n M-8 select-window -t 8
|
|
bind-key -n M-9 select-window -t 9
|
|
|
|
# swap panes
|
|
bind-key -n 'M-r' swap-pane -D
|
|
bind-key -n 'M-R' swap-pane -U
|
|
|
|
# move panes to and from windows
|
|
bind-key -n 'M-t' command-prompt -p "Move pane to tab:" "join-pane -t :'%%'"
|
|
bind-key -n 'M-!' select-layout even-horizontal
|
|
bind-key -n 'M-@' select-layout even-vertical
|
|
bind-key -n 'M-#' select-layout main-vertical
|
|
|
|
# move windows
|
|
bind-key -n M-. command-prompt -p "Swab tab with:" "swap-window -t :'%%'"
|
|
|
|
# resize panes
|
|
bind-key -n 'M-H' resize-pane -L 5
|
|
bind-key -n 'M-L' resize-pane -R 5
|
|
bind-key -n 'M-K' resize-pane -U 5
|
|
bind-key -n 'M-J' resize-pane -D 5
|
|
|
|
# popups
|
|
bind-key -n M-f if-shell -F '#{==:#{session_name},popup}' {
|
|
detach-client
|
|
} {
|
|
display-popup -E -w 70% -h 70% "tmux new-session -A -s popup"
|
|
}
|
|
|
|
### Misc
|
|
|
|
# alias
|
|
set -s command-alias[1] respawn='respawn-pane -k'
|
|
|
|
# make escape bindings of programs work in tmux
|
|
set -s escape-time 5
|
|
|
|
# renumber windows, when one gets closed
|
|
set-option -g renumber-windows on
|
|
|
|
# enable mouse
|
|
set-option -g mouse on
|
|
|
|
# start pane index at 1
|
|
set -g base-index 1
|
|
setw -g pane-base-index 1
|
|
|
|
### Theme
|
|
|
|
set -g main-pane-width 40%
|
|
|
|
# set terminal window title (update every second)
|
|
set-option -g status-interval 1
|
|
set-option -g set-titles on
|
|
set-option -g set-titles-string "#H: #W"
|
|
|
|
# Pane borders
|
|
set -g pane-border-style fg=#8da101
|
|
set -g pane-border-status top
|
|
set -g pane-border-lines single
|
|
set -g pane-border-format " #{?pane_active,#[bold],#[fg=#c3c6b2]}#{pane_index} "
|
|
set -g pane-border-indicators colour
|
|
|
|
# Status
|
|
set -g status-style bg=default
|
|
set -g message-style bg=default
|
|
set -g status-right "#[fg=yellow]#H(#S) #[fg=blue]#{=100:pane_current_path}#[fg=black]"
|
|
set -g status-right-length 200
|
|
set -g status-left ""
|
|
set -g window-status-format "#[fg=#c3c6b2]#I:#W#[fg=default] "
|
|
set -g window-status-current-format "#I:#W "
|
|
|