dotfiles/tmux/.config/tmux/tmux.conf

78 lines
2.6 KiB
Plaintext

# May not be loaded on older versions of tmux
set -g default-terminal "tmux-256color"
# status powerline-like theme, no dependencies.
set -g status on
set -g status-bg '#232629'
set -g status-fg colour7
set -g status-left '#[fg=colour235,bg=colour4,bold] #S #[fg=colour4,bg=colour235,nobold]'
set -g window-status-format "#[default] #I #[fg=colour240] #[default]#W "
set -g window-status-bell-style "bold"
set -g window-status-current-format "#[fg=colour235,bg=colour6]#[fg=colour235,bg=colour6,bold] #I  #[fg=colour235]#W #[fg=colour6,bg=colour235,nobold]"
set -g status-right '#{prefix_highlight}#[fg=colour6,bg=colour235]#[fg=colour235,bg=colour6] #{=21:pane_title} #[fg=colour4,bg=colour6,nobold]#[fg=colour235,bg=colour4] %H:%M '
set -g @prefix_highlight_output_prefix "#[fg=colour4]#[bg=colour235]#[bg=colour4]#[fg=colour235]"
set -g @prefix_highlight_output_suffix ""
set -g @prefix_highlight_prefix_prompt " "
# No delay between hitting <ESC>
set-option -s escape-time 0
# Mouse support
set-option -g mouse on
# Start with 1 instead of 0
set -g base-index 1
set -g pane-base-index 1
# Panes
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
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
# Windows
bind c new-window -c "#{pane_current_path}"
bind -n M-S-Right select-window -n
bind -n M-S-Left select-window -p
# set-option -g allow-rename off # Don't autorename windows
set -g renumber-windows on
# Show menu of URLs to open from the visible pane - needs `urlview'
bind u capture-pane \;\
save-buffer /tmp/tmux-buffer \;\
split-window -l 10 "urlscan /tmp/tmux-buffer"
# Allow programs with their own scrollback to scroll properly
bind-key -n WheelUpPane \
if-shell -Ft= "#{?pane_active,0,1}" "select-pane -t=" \; \
if-shell -Ft= "#{pane_in_mode}" \
"send-keys -M ; send-keys -M ; send-keys -M" \
"if-shell -Ft= \"#{mouse_any_flag}\" \
\"send-keys -M\" \
\"if-shell -Ft= '#{alternate_on}' \
'send-keys Up Up Up' \
'copy-mode -e'\""
bind-key -n WheelDownPane \
if-shell -Ft= "#{?pane_active,0,1}" "select-pane -t=" \; \
if-shell -Ft= "#{pane_in_mode}" \
"send-keys -M ; send-keys -M ; send-keys -M" \
"if-shell -Ft= \"#{mouse_any_flag}\" \
\"send-keys -M\" \
\"if-shell -Ft= '#{alternate_on}' \
'send-keys Down Down Down'\""
# source `.tmux.conf` file - as suggested in `man tmux`
bind-key R run-shell ' \
tmux source-file $XDG_CONFIG_HOME/tmux/tmux.conf > /dev/null; \
tmux display-message "sourced tmux.conf"'