Skip to content

Conversation

aacebedo
Copy link

I have added the support of characters at the start and the end of the indicator.
It is backward compatible with current behaviour and allow to create nice pill like indicator like this:
image

@MunifTanjim
Copy link
Owner

This plugin is intentionally kept simple. (ref:

_Note: This is a trimmed down version of the original [tmux-prefix-highlight](https://github.com/tmux-plugins/tmux-prefix-highlight) plugin._
)

What you want can be done like this:

mode_separator_style="#[default]#{?client_prefix,#[fg=blue],#{?pane_in_mode,#[fg=yellow],#{?pane_synchronized,#[fg=brightred],#[fg=cyan]}}}"
mode_separator_start="${mode_separator_style}${mode_separator_style}#[reverse]"
mode_separator_end="${mode_separator_style}${mode_separator_style}#[default]"

set -g @mode_indicator_prefix_prompt "${mode_separator_start}WAIT${mode_separator_end}"
set -g @mode_indicator_prefix_mode_style ""
set -g @mode_indicator_copy_prompt "${mode_separator_start}COPY${mode_separator_end}"
set -g @mode_indicator_copy_mode_style ""
set -g @mode_indicator_sync_prompt "${mode_separator_start}SYNC${mode_separator_end}"
set -g @mode_indicator_sync_mode_style ""
set -g @mode_indicator_empty_prompt "${mode_separator_start}TMUX${mode_separator_end}"
set -g @mode_indicator_empty_mode_style ""

set -g @plugin 'MunifTanjim/tmux-mode-indicator'

@seiuneko
Copy link

seiuneko commented Jun 4, 2025

Use %hidden to define environment variables only within tmux:

%hidden mode_separator_style="#[default]#{?client_prefix,#[fg=blue],#{?pane_in_mode,#[fg=yellow],#{?pane_synchronized,#[fg=brightred],#[fg=cyan]}}}"
%hidden mode_separator_start="${mode_separator_style}${mode_separator_style}#[reverse]"
%hidden mode_separator_end="${mode_separator_style}${mode_separator_style}#[default]"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants