dotfiles/dot_config/tmux/tmux.conf.tmpl

96 lines
2.4 KiB
Cheetah
Raw Normal View History

2024-02-17 19:16:45 +01:00
# change prefix wihout unbinding the default C-b
#set-option -g prefix C-a
#bind-key C-a send-prefix
# Split panes using | and -
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
bind c new-window -c "#{pane_current_path}"
# fast reload
2024-02-17 21:02:39 +01:00
bind r source-file ~/.config/tmux/tmux.conf
2024-02-17 19:16:45 +01:00
# switch panes using alt+arrow
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
set -g mouse on
2024-02-18 02:05:43 +01:00
# nvim fixes
set -sg escape-time 300
set -g focus-events on
2024-02-17 19:16:45 +01:00
# don't rename windows automatically
set-option -g allow-rename off
2024-02-17 20:45:36 +01:00
# vim mode for copying
setw -g mode-keys vi
# prefix + v to enter copy mode
bind v copy-mode
# v to start a visual selection
bind -T copy-mode-vi v send -X begin-selection
2024-02-17 20:59:39 +01:00
{{- if eq .chezmoi.os "darwin" }}
# y to yank
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
# mouse support
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
{{- else }}
2024-02-17 20:45:36 +01:00
# y to yank
bind -T copy-mode-vi y send -X copy-pipe-and-cancel
# mouse support
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel
2024-02-17 20:59:39 +01:00
{{- end }}
# prefix + P to paste
bind P paste-buffer
2024-02-17 20:45:36 +01:00
# color support
2024-02-18 02:05:43 +01:00
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",tmux-256color:Tc"
2024-02-17 19:16:45 +01:00
bind u capture-pane \;\
save-buffer /tmp/tmux-buffer \;\
split-window -l 10 "urlview /tmp/tmux-buffer"
# DESIGN
# clock mode
2024-02-19 19:22:36 +01:00
setw -g clock-mode-colour white
2024-02-17 19:16:45 +01:00
# copy mode
2024-02-19 19:22:36 +01:00
setw -g mode-style 'fg=white bg=red bold'
2024-02-17 19:16:45 +01:00
# pane borders
2024-02-19 19:22:36 +01:00
set -g pane-border-style 'fg=red'
set -g pane-active-border-style 'fg=yellow'
2024-02-17 19:16:45 +01:00
# statusbar
set -g status-position bottom
set -g status-justify left
2024-02-19 19:22:36 +01:00
set -g status-style 'fg=blue'
set -g status-left ' '
set -g status-right '%Y-%m-%d %H:%M'
2024-02-17 19:16:45 +01:00
set -g status-right-length 50
set -g status-left-length 10
2024-02-19 19:22:36 +01:00
setw -g window-status-current-style 'fg=default bg=blue bold'
2024-02-17 19:16:45 +01:00
setw -g window-status-current-format ' #I #W #F '
2024-02-20 00:17:29 +01:00
setw -g window-status-style 'fg=blue'
2024-02-19 19:22:36 +01:00
setw -g window-status-format ' #I #W #F '
2024-02-17 19:16:45 +01:00
2024-02-19 19:22:36 +01:00
setw -g window-status-bell-style 'fg=black bg=yellow bold'
2024-02-17 19:16:45 +01:00
# messages
2024-02-19 19:22:36 +01:00
set -g message-style 'fg=black bg=white bold'
2024-11-20 03:20:36 +01:00
# https://gitlab.com/gnachman/iterm2/-/wikis/tmux-Integration-Best-Practices#i-want-to-see-tmux-window-titles-as-tabwindow-titles-in-iterm2
set-option -g set-titles on
set-option -g set-titles-string '#T'
2024-02-27 15:03:10 +01:00
set-option -g default-shell /usr/bin/fish