From ecc4b13bcd45615ebde535745f832285227111d6 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 20 May 2020 20:43:09 -0400 Subject: allow customizing the separator --- README.rst | 11 ++++++++--- tmux-colortag.tmux | 10 ++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 47f6e48..47a9c05 100644 --- a/README.rst +++ b/README.rst @@ -48,11 +48,14 @@ Installation - To immediately play with the main feature, try ``prefix`` (``Ctrl+b`` by default) + ``,`` and change the window name. - NOTE: tmux won't change the window name automatically once you set it manually. To test the auto-changing color, just run any command in your new window. -- Optional: for the best experience, this plugin assumes a short status update +Customization +============= + +- For the best experience, this plugin assumes a short status update interval. To change it back, specify ``TMUX_COLORTAG_SET_INTERVAL=no`` or directly override the setting in your tmux config file. -- Optional: if you don't like powerline symbols, feel free to change them by +- If you don't like powerline symbols, feel free to change them by specifying the following environment variables to override the default: - ``TMUX_ARROW_SYMBOL_L1`` @@ -60,9 +63,11 @@ Installation - ``TMUX_ARROW_SYMBOL_R1`` - ``TMUX_ARROW_SYMBOL_R2`` -- Optional: if you only want to color the tags (without changing other styles +- If you only want to color the tags (without changing other styles such as borders), specify ``TMUX_COLORTAG_TAG_ONLY=yes``. +- ``TMUX_COLORTAG_IDX_SEP`` controls the separator between the window index and name. + Update to the Latest Version ============================ diff --git a/tmux-colortag.tmux b/tmux-colortag.tmux index d05f739..b937ac1 100755 --- a/tmux-colortag.tmux +++ b/tmux-colortag.tmux @@ -51,15 +51,17 @@ TAB_FOCUS_BEGIN_FG="#[fg=$color2]" TAB_FOCUS_BEGIN="${TAB_FOCUS_BEGIN_BG}${TAB_FOCUS_BEGIN_FG}" if [[ "$TMUX_COLORTAG_NOPOWERLINE" == yes ]]; then + TMUX_COLORTAG_IDX_SEP="${TMUX_COLORTAG_IDX_SEP:-|}" tmux set -g status-left "${LEFTBAR_FORMAT} ${RECOVER_BG} " tmux set -g status-right "${RIGHTBAR_DEFAULT} ${LOAD_DISP} ${RIGHTBAR_HOST} #h " - tmux set -g window-status-format "${TAB_NORMAL_BEGIN} #I|#W ${TAB_END} " - tmux set -g window-status-current-format "${TAB_FOCUS_BEGIN} #I|#W ${TAB_END} " + tmux set -g window-status-format "${TAB_NORMAL_BEGIN} #I${TMUX_COLORTAG_IDX_SEP}#W ${TAB_END} " + tmux set -g window-status-current-format "${TAB_FOCUS_BEGIN} #I${TMUX_COLORTAG_IDX_SEP}#W ${TAB_END} " else TMUX_ARROW_SYMBOL_L1="${TMUX_ARROW_SYMBOL_L1:-$(printf '\ue0b6')}" TMUX_ARROW_SYMBOL_L2="${TMUX_ARROW_SYMBOL_L2:-$(printf '\ue0b7')}" TMUX_ARROW_SYMBOL_R1="${TMUX_ARROW_SYMBOL_R1:-$(printf '\ue0b4')}" TMUX_ARROW_SYMBOL_R2="${TMUX_ARROW_SYMBOL_R2:-$(printf '\ue0b5')}" + TMUX_COLORTAG_IDX_SEP="${TMUX_COLORTAG_IDX_SEP:-$TMUX_ARROW_SYMBOL_R2}" tmux set -g status-left "${LEFTBAR_FORMAT}${RECOVER_BG}${TMUX_ARROW_SYMBOL_R1} " tmux set -g status-right "$(printf %s \ @@ -69,8 +71,8 @@ else "${RIGHTBAR_HOST}#h ")" tmux set -g window-status-format "$(printf %s \ "${TAB_NORMAL_BEGIN}$TMUX_ARROW_SYMBOL_R1 " \ - "#I$TMUX_ARROW_SYMBOL_R2#W${TAB_END}$TMUX_ARROW_SYMBOL_R1 ")" + "#I${TMUX_COLORTAG_IDX_SEP}#W${TAB_END}$TMUX_ARROW_SYMBOL_R1 ")" tmux set -g window-status-current-format "$(printf %s \ "${TAB_FOCUS_BEGIN_BG}$TMUX_ARROW_SYMBOL_R1 " \ - "${TAB_FOCUS_BEGIN_FG}#I$TMUX_ARROW_SYMBOL_R2#W${TAB_END}$TMUX_ARROW_SYMBOL_R1 ")" + "${TAB_FOCUS_BEGIN_FG}#I${TMUX_COLORTAG_IDX_SEP}#W${TAB_END}$TMUX_ARROW_SYMBOL_R1 ")" fi -- cgit v1.2.3