refactor: 将 .tmux 和 tmux 改为 git submodule

- .tmux → https://github.com/gpakosz/.tmux.git
- tmux → https://github.com/tmux/tmux.git
This commit is contained in:
tukuaiai 2026-02-12 02:02:28 +08:00
parent f7cc01fcae
commit be1c545445
15 changed files with 8 additions and 3088 deletions

6
.gitmodules vendored Normal file
View File

@ -0,0 +1,6 @@
[submodule "libs/external/.tmux"]
path = libs/external/.tmux
url = https://github.com/gpakosz/.tmux.git
[submodule "libs/external/tmux"]
path = libs/external/tmux
url = https://github.com/tmux/tmux.git

1
libs/external/.tmux vendored Submodule

@ -0,0 +1 @@
Subproject commit 87dcd13a28aeb5f18baee630e24b3f5765ae3a4f

View File

@ -1,7 +0,0 @@
* text=auto
# git
.gitignore text
.tmux.conf eol=lf
.tmux.conf.local eol=lf

View File

@ -1 +0,0 @@
github: gpakosz

View File

@ -1 +0,0 @@
plugins/**

View File

@ -1,16 +0,0 @@
Oh my tmux! logo copyright (c) 2024, Gregory Pakosz <gregory.pakosz@gmail.com>
Original tmux logo copyright (c) 2015, Jason Long <jason@jasonlong.me>
See https://github.com/tmux/tmux/tree/master/logo
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1254 187"><path fill="#00afff" d="M240 147.4c29.6 0 50.4-25.6 50.4-68.6 0-42.4-20.8-67.4-50.4-67.4s-50.4 25-50.4 67.4c0 43 20.8 68.6 50.4 68.6zm0-14.6c-20 0-33.2-20.4-33.2-54 0-33 13.2-52.8 33.2-52.8s33.2 19.8 33.2 52.8c0 33.6-13.2 54-33.2 54zm68.52 12.2h16.4V77.2c11.4-11.8 19.2-17.6 30.8-17.6 16 0 22.4 8.8 22.4 27.2V145h16.4V84.6c0-25.6-10.6-39.2-33.6-39.2-15.2 0-26.4 8.2-36.4 19h-.6l1-23V2.6h-16.4zm162.85 0h16.4V74.6c4.8-10 9.2-15 16-15 7.2 0 10 5.8 10 17V145h15.2V74.6c5.2-10 8.8-15 15.6-15 7.2 0 10.4 5.8 10.4 17V145h16.4V75.4c0-19.4-8-30-21.6-30-11.2 0-17.2 6.4-22.8 16.8-2.8-11.2-8.8-16.8-18.4-16.8-11.2 0-17.2 6.2-22.2 15.2h-.4l-1.4-12.8h-13.2zm124.52 41.8c22 0 34-14.6 41.2-33.8l42.8-105.2h-15.6l-21.2 53.8c-3.2 8.8-7 19-10.4 28.2h-.8c-4-9.4-8.2-19.6-12-28.2l-23.8-53.8h-16.6l45.4 97.4-3 7.2c-4.8 12-13 20.8-26.6 20.8-3 0-6.2-.6-8.8-1.4l-3.4 13c3.4 1.2 8.2 2 12.8 2zm222.44-39.4c12.2 0 21.6-2.6 30.4-5.8l-3.6-12c-7 2.6-14.2 4.4-23.4 4.4-18.8 0-24.6-9.2-24.6-26.6V61.2h47.8V47.8h-47.8V16.6h-13.6l-2.2 31.2-28 1v12.4h27.4v46c0 24 9.2 40.2 37.6 40.2zm42.72-2.4h16.4V74.6c4.8-10 9.2-15 16-15 7.2 0 10 5.8 10 17V145h15.2V74.6c5.2-10 8.8-15 15.6-15 7.2 0 10.4 5.8 10.4 17V145h16.4V75.4c0-19.4-8-30-21.6-30-11.2 0-17.2 6.4-22.8 16.8-2.8-11.2-8.8-16.8-18.4-16.8-11.2 0-17.2 6.2-22.2 15.2h-.4l-1.4-12.8h-13.2zm147.55 2.4c15 0 26.4-8 36.2-19.4h.8l1.4 17h13.4V47.8H1044v67.4c-10.8 12.6-19 18-30.2 18-16.2 0-22.4-8.8-22.4-27.2V47.8h-16.6v60.4c0 25.6 10.6 39.2 33.8 39.2zm73.5-2.4h17.6l16-22.4c4-6.2 8-11.8 12-17.6h.8c4.2 5.6 8.8 12 12.8 17.6l17 22.4h18l-37.2-49 34.6-48.2h-17.4l-14.6 21c-3.4 5.4-7.4 11.4-11 16.8h-.8c-4-5.4-8-11.2-11.4-16.4l-15.4-21.4h-18.2l34.2 46.8zm151.5-46.4h11.2l2-68.8.4-18.8h-16l.4 18.8zm5.6 48.8c8 0 14.6-6 14.6-15.6 0-9.4-6.6-15.2-14.6-15.2s-14.6 5.8-14.6 15.2c0 9.6 6.6 15.6 14.6 15.6z" aria-label="Oh my tmux!"/><path fill="#fff" d="M76.892 144.526h7.91V76.812h76.014l.03-7.85-76.044-.06V-.131h-7.91z"/><path fill="#3c3c3c" fill-rule="evenodd" d="M83.788 69.866v-70h-6v146h6v-70h77v-6zm-83-54.994C.788 6.584 7.51-.134 15.786-.134h130c8.283 0 14.998 6.725 14.998 15.006v130.99h-160z"/><path fill="#ff0" d="m2 146 23-1v13.719s-14.06 1.335-18.379-2.658C1.471 151.301 2 146.001 2 146.001z" style="mix-blend-mode:normal" transform="translate(.788 -.134)"/><path fill="#ff00af" d="M25 145h30v13.719H25z" style="mix-blend-mode:normal" transform="translate(.788 -.134)"/><path fill="#3c3c3c" d="M55 145h5v13.719h-5z" style="mix-blend-mode:normal" transform="translate(.788 -.134)"/><path fill="#00afff" d="M60 145h17v13.719H60z" style="mix-blend-mode:normal" transform="translate(.788 -.134)"/><path fill="#3c3c3c" d="M77 145h54.248v13.719H77z" style="mix-blend-mode:normal" transform="translate(.788 -.134)"/><path fill="#fff" d="m157.95 146-13.053-1-9.947 13.719s14.06 1.335 18.379-2.658c5.15-4.76 4.62-10.06 4.62-10.06z" style="mix-blend-mode:normal" transform="translate(.788 -.134)"/><path fill="#d70000" d="M131.25 145h13.752v13.719H131.25z" style="mix-blend-mode:normal" transform="translate(.788 -.134)"/><path fill="#3c3c3c" fill-rule="evenodd" d="M2.788 144.866c0 7.189 5.816 13.004 12.998 13.004h130c7.174 0 12.998-5.824 12.998-13.004m2 0c0 8.287-6.722 15.004-14.998 15.004h-130c-8.283 0-14.998-6.706-14.998-15.004m2 1.004-2-2h160l-2 2m2 0h-160"/></svg>

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 160"><path fill="#fff" d="M76.104 144.66h7.91V76.946h76.014l.03-7.85-76.044-.06V.003h-7.91z"/><path fill="#3c3c3c" fill-rule="evenodd" d="M83 70V0h-6v146h6V76h77v-6zM0 15.006C0 6.718 6.722 0 14.998 0h130c8.283 0 14.998 6.725 14.998 15.006v130.99h-160z"/><path fill="#ff0" d="m2 146 23-1v13.719s-14.06 1.335-18.379-2.658C1.471 151.301 2 146.001 2 146.001z" style="mix-blend-mode:normal"/><path fill="#ff00af" d="M25 145h30v13.719H25z" style="mix-blend-mode:normal"/><path fill="#3c3c3c" d="M55 145h5v13.719h-5z" style="mix-blend-mode:normal"/><path fill="#00afff" d="M60 145h17v13.719H60z" style="mix-blend-mode:normal"/><path fill="#3c3c3c" d="M77 145h54.248v13.719H77z" style="mix-blend-mode:normal"/><path fill="#fff" d="m157.95 146-13.053-1-9.947 13.719s14.06 1.335 18.379-2.658c5.15-4.76 4.62-10.06 4.62-10.06z" style="mix-blend-mode:normal"/><path fill="#d70000" d="M131.25 145h13.752v13.719H131.25z" style="mix-blend-mode:normal"/><path fill="#3c3c3c" fill-rule="evenodd" d="M2 145c0 7.189 5.816 13.004 12.998 13.004h130c7.174 0 12.998-5.824 12.998-13.004m2 0c0 8.287-6.722 15.004-14.998 15.004h-130C6.715 160.004 0 153.298 0 145m2 1.004-2-2h160l-2 2m2 0H0"/></svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,509 +0,0 @@
# : << 'EOF'
# Oh my tmux!
# 💛🩷💙🖤❤️🤍
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# -- bindings ------------------------------------------------------------------
# preserve tmux stock bindings,
# while adding bindings that don't conflict with these stock bindings
# /!\ this disables some of Oh my tmux! bindings described in README.md
# - true
# - false (default)
tmux_conf_preserve_stock_bindings=false
# -- session creation ----------------------------------------------------------
# prompt for session name when creating a new session, possible values are:
# - true
# - false (default)
# - disabled (do not modify new-session bindings)
tmux_conf_new_session_prompt=false
# new session retains current path, possible values are:
# - true
# - false (default)
# - disabled (do not modify new-session bindings)
tmux_conf_new_session_retain_current_path=false
# -- windows & pane creation ---------------------------------------------------
# new window retains current path, possible values are:
# - true
# - false (default)
# - disabled (do not modify new-window bindings)
tmux_conf_new_window_retain_current_path=false
# new window tries to reconnect ssh sessions, possible values are:
# - true
# - false (default)
# - disabled (do not modify new-window bindings)
tmux_conf_new_window_reconnect_ssh=false
# new pane retains current path, possible values are:
# - true (default)
# - false
# - disabled (do not modify split-window bindings)
tmux_conf_new_pane_retain_current_path=true
# new pane tries to reconnect ssh sessions, possible values are:
# - true
# - false (default)
# - disabled (do not modify split-window bindings)
tmux_conf_new_pane_reconnect_ssh=false
# -- display -------------------------------------------------------------------
# RGB 24-bit colour support, possible values are:
# - true
# - false
# - auto (default)
#
# automatic detection relies on the COLORTERM environment variable being defined
# to 'truecolor' or '24bit' or '$ tput colors' answering '16777216'
# see https://github.com/termstandard/colors
tmux_conf_24b_colour=auto
# -- theming -------------------------------------------------------------------
# enable or disable theming:
# - enabled (default)
# - disabled
# when disabled, all tmux_conf_theme_xxx variables are ignored except:
# - tmux_conf_theme_pairing
# - tmux_conf_theme_prefix
# - tmux_conf_theme_mouse
# - tmux_conf_theme_root
# - tmux_conf_theme_synchronized
tmux_conf_theme=enabled
# default theme
tmux_conf_theme_colour_1="#080808" # dark gray
tmux_conf_theme_colour_2="#303030" # gray
tmux_conf_theme_colour_3="#8a8a8a" # light gray
tmux_conf_theme_colour_4="#00afff" # light blue
tmux_conf_theme_colour_5="#ffff00" # yellow
tmux_conf_theme_colour_6="#080808" # dark gray
tmux_conf_theme_colour_7="#e4e4e4" # white
tmux_conf_theme_colour_8="#080808" # dark gray
tmux_conf_theme_colour_9="#ffff00" # yellow
tmux_conf_theme_colour_10="#ff00af" # pink
tmux_conf_theme_colour_11="#5fff00" # green
tmux_conf_theme_colour_12="#8a8a8a" # light gray
tmux_conf_theme_colour_13="#e4e4e4" # white
tmux_conf_theme_colour_14="#080808" # dark gray
tmux_conf_theme_colour_15="#080808" # dark gray
tmux_conf_theme_colour_16="#d70000" # red
tmux_conf_theme_colour_17="#e4e4e4" # white
# default theme (ansi)
#tmux_conf_theme_colour_1="colour0"
#tmux_conf_theme_colour_2="colour8"
#tmux_conf_theme_colour_3="colour8"
#tmux_conf_theme_colour_4="colour14"
#tmux_conf_theme_colour_5="colour11"
#tmux_conf_theme_colour_6="colour0"
#tmux_conf_theme_colour_7="colour15"
#tmux_conf_theme_colour_8="colour0"
#tmux_conf_theme_colour_9="colour11"
#tmux_conf_theme_colour_10="colour13"
#tmux_conf_theme_colour_11="colour10"
#tmux_conf_theme_colour_12="colour8"
#tmux_conf_theme_colour_13="colour15"
#tmux_conf_theme_colour_14="colour0"
#tmux_conf_theme_colour_15="colour0"
#tmux_conf_theme_colour_16="colour1"
#tmux_conf_theme_colour_17="colour15"
# window style
tmux_conf_theme_window_fg="default"
tmux_conf_theme_window_bg="default"
# highlight focused pane, possible values are:
# - true
# - false (default)
tmux_conf_theme_highlight_focused_pane=false
# focused pane colours:
tmux_conf_theme_focused_pane_bg="$tmux_conf_theme_colour_2"
# pane border style, possible values are:
# - thin (default)
# - fat
tmux_conf_theme_pane_border_style=thin
# pane borders colours:
tmux_conf_theme_pane_border="$tmux_conf_theme_colour_2"
tmux_conf_theme_pane_active_border="$tmux_conf_theme_colour_4"
%if #{>=:#{version},3.2}
tmux_conf_theme_pane_active_border="#{?pane_in_mode,$tmux_conf_theme_colour_9,#{?synchronize-panes,$tmux_conf_theme_colour_16,$tmux_conf_theme_colour_4}}"
%endif
# pane indicator colours (when you hit <prefix> + q)
tmux_conf_theme_pane_indicator="$tmux_conf_theme_colour_4"
tmux_conf_theme_pane_active_indicator="$tmux_conf_theme_colour_4"
# status line style
tmux_conf_theme_message_fg="$tmux_conf_theme_colour_1"
tmux_conf_theme_message_bg="$tmux_conf_theme_colour_5"
tmux_conf_theme_message_attr="bold"
# status line command style (<prefix> : Escape)
tmux_conf_theme_message_command_fg="$tmux_conf_theme_colour_5"
tmux_conf_theme_message_command_bg="$tmux_conf_theme_colour_1"
tmux_conf_theme_message_command_attr="bold"
# window modes style
tmux_conf_theme_mode_fg="$tmux_conf_theme_colour_1"
tmux_conf_theme_mode_bg="$tmux_conf_theme_colour_5"
tmux_conf_theme_mode_attr="bold"
# status line style
tmux_conf_theme_status_fg="$tmux_conf_theme_colour_3"
tmux_conf_theme_status_bg="$tmux_conf_theme_colour_1"
tmux_conf_theme_status_attr="none"
# terminal title
# - built-in variables are:
# - #{circled_window_index}
# - #{circled_session_name}
# - #{hostname}
# - #{hostname_ssh}
# - #{hostname_full}
# - #{hostname_full_ssh}
# - #{username}
# - #{username_ssh}
tmux_conf_theme_terminal_title="#h ❐ #S ● #I #W"
# window status style
# - built-in variables are:
# - #{circled_window_index}
# - #{circled_session_name}
# - #{hostname}
# - #{hostname_ssh}
# - #{hostname_full}
# - #{hostname_full_ssh}
# - #{username}
# - #{username_ssh}
tmux_conf_theme_window_status_fg="$tmux_conf_theme_colour_3"
tmux_conf_theme_window_status_bg="$tmux_conf_theme_colour_1"
tmux_conf_theme_window_status_attr="none"
tmux_conf_theme_window_status_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
#tmux_conf_theme_window_status_format="#{circled_window_index} #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
#tmux_conf_theme_window_status_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
# window current status style
# - built-in variables are:
# - #{circled_window_index}
# - #{circled_session_name}
# - #{hostname}
# - #{hostname_ssh}
# - #{hostname_full}
# - #{hostname_full_ssh}
# - #{username}
# - #{username_ssh}
tmux_conf_theme_window_status_current_fg="$tmux_conf_theme_colour_1"
tmux_conf_theme_window_status_current_bg="$tmux_conf_theme_colour_4"
tmux_conf_theme_window_status_current_attr="bold"
tmux_conf_theme_window_status_current_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
#tmux_conf_theme_window_status_current_format="#{circled_window_index} #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
#tmux_conf_theme_window_status_current_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
# window activity status style
tmux_conf_theme_window_status_activity_fg="default"
tmux_conf_theme_window_status_activity_bg="default"
tmux_conf_theme_window_status_activity_attr="underscore"
# window bell status style
tmux_conf_theme_window_status_bell_fg="$tmux_conf_theme_colour_5"
tmux_conf_theme_window_status_bell_bg="default"
tmux_conf_theme_window_status_bell_attr="blink,bold"
# window last status style
tmux_conf_theme_window_status_last_fg="$tmux_conf_theme_colour_4"
tmux_conf_theme_window_status_last_bg="$tmux_conf_theme_colour_2"
tmux_conf_theme_window_status_last_attr="none"
# status left/right sections separators
tmux_conf_theme_left_separator_main=""
tmux_conf_theme_left_separator_sub="|"
tmux_conf_theme_right_separator_main=""
tmux_conf_theme_right_separator_sub="|"
#tmux_conf_theme_left_separator_main='\uE0B0' # /!\ you don't need to install Powerline
#tmux_conf_theme_left_separator_sub='\uE0B1' # you only need fonts patched with
#tmux_conf_theme_right_separator_main='\uE0B2' # Powerline symbols or the standalone
#tmux_conf_theme_right_separator_sub='\uE0B3' # PowerlineSymbols.otf font, see README.md
# status left/right content:
# - separate main sections with "|"
# - separate subsections with ","
# - built-in variables are:
# - #{battery_bar}
# - #{battery_hbar}
# - #{battery_percentage}
# - #{battery_status}
# - #{battery_vbar}
# - #{circled_session_name}
# - #{hostname_ssh}
# - #{hostname}
# - #{hostname_full}
# - #{hostname_full_ssh}
# - #{loadavg}
# - #{mouse}
# - #{pairing}
# - #{prefix}
# - #{root}
# - #{synchronized}
# - #{uptime_y}
# - #{uptime_d} (modulo 365 when #{uptime_y} is used)
# - #{uptime_h}
# - #{uptime_m}
# - #{uptime_s}
# - #{username}
# - #{username_ssh}
tmux_conf_theme_status_left=" ❐ #S | ↑#{?uptime_y, #{uptime_y}y,}#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} "
#tmux_conf_theme_status_left=" ❐ #S | ↑#{?uptime_y, #{uptime_y}y,}#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} | #{pretty_pane_current_path} "
tmux_conf_theme_status_right=" #{prefix}#{mouse}#{pairing}#{synchronized}#{?battery_status,#{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} "
# status left style
tmux_conf_theme_status_left_fg="$tmux_conf_theme_colour_6,$tmux_conf_theme_colour_7,$tmux_conf_theme_colour_8"
tmux_conf_theme_status_left_bg="$tmux_conf_theme_colour_9,$tmux_conf_theme_colour_10,$tmux_conf_theme_colour_11"
tmux_conf_theme_status_left_attr="bold,none,none"
# status right style
tmux_conf_theme_status_right_fg="$tmux_conf_theme_colour_12,$tmux_conf_theme_colour_13,$tmux_conf_theme_colour_14"
tmux_conf_theme_status_right_bg="$tmux_conf_theme_colour_15,$tmux_conf_theme_colour_16,$tmux_conf_theme_colour_17"
tmux_conf_theme_status_right_attr="none,none,bold"
# pairing indicator
tmux_conf_theme_pairing="⚇" # U+2687
tmux_conf_theme_pairing_fg="none"
tmux_conf_theme_pairing_bg="none"
tmux_conf_theme_pairing_attr="none"
# prefix indicator
tmux_conf_theme_prefix="⌨" # U+2328
tmux_conf_theme_prefix_fg="none"
tmux_conf_theme_prefix_bg="none"
tmux_conf_theme_prefix_attr="none"
# mouse indicator
tmux_conf_theme_mouse="↗" # U+2197
tmux_conf_theme_mouse_fg="none"
tmux_conf_theme_mouse_bg="none"
tmux_conf_theme_mouse_attr="none"
# root indicator
tmux_conf_theme_root="!"
tmux_conf_theme_root_fg="none"
tmux_conf_theme_root_bg="none"
tmux_conf_theme_root_attr="bold,blink"
# synchronized indicator
tmux_conf_theme_synchronized="⚏" # U+268F
tmux_conf_theme_synchronized_fg="none"
tmux_conf_theme_synchronized_bg="none"
tmux_conf_theme_synchronized_attr="none"
# battery bar symbols
tmux_conf_battery_bar_symbol_full="◼"
tmux_conf_battery_bar_symbol_empty="◻"
#tmux_conf_battery_bar_symbol_full="♥"
#tmux_conf_battery_bar_symbol_empty="·"
# battery bar length (in number of symbols), possible values are:
# - auto
# - a number, e.g. 5
tmux_conf_battery_bar_length="auto"
# battery bar palette, possible values are:
# - gradient (default)
# - heat
# - "colour_full_fg,colour_empty_fg,colour_bg"
# - gradient(colour_fg_1,colour_fg_2,...,colour_fg_n)
tmux_conf_battery_bar_palette="gradient"
#tmux_conf_battery_bar_palette="#d70000,#e4e4e4,#000000" # red, white, black
#tmux_conf_battery_bar_palette="gradient(#00afff,#47a2ff,#7c91ff,#ac7afb,#d65be2,#e163df,#eb6cdd,#f475db,#ec9ff1,#eac3fe,#efe2ff,#ffffff)"
# battery hbar palette, possible values are:
# - gradient (default)
# - heat
# - "colour_low,colour_half,colour_full"
# - gradient(colour_fg_1,colour_fg_2,...,colour_fg_n)
tmux_conf_battery_hbar_palette="gradient"
#tmux_conf_battery_hbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green
#tmux_conf_battery_hbar_palette="gradient(#00afff,#47a2ff,#7c91ff,#ac7afb,#d65be2,#e163df,#eb6cdd,#f475db,#ec9ff1,#eac3fe,#efe2ff,#ffffff)"
# battery vbar palette, possible values are:
# - gradient (default)
# - heat
# - "colour_low,colour_half,colour_full"
# - gradient(colour_fg_1,colour_fg_2,...,colour_fg_n)
tmux_conf_battery_vbar_palette="gradient"
#tmux_conf_battery_vbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green
#tmux_conf_battery_vbar_palette="gradient(#00afff,#47a2ff,#7c91ff,#ac7afb,#d65be2,#e163df,#eb6cdd,#f475db,#ec9ff1,#eac3fe,#efe2ff,#ffffff)"
# symbols used to indicate whether battery is charging or discharging
tmux_conf_battery_status_charging="↑" # U+2191
tmux_conf_battery_status_discharging="↓" # U+2193
#tmux_conf_battery_status_charging="🔌" # U+1F50C
#tmux_conf_battery_status_discharging="🔋" # U+1F50B
# clock style (when you hit <prefix> + t)
# you may want to use %I:%M %p in place of %R in tmux_conf_theme_status_right
tmux_conf_theme_clock_colour="$tmux_conf_theme_colour_4"
tmux_conf_theme_clock_style="24"
# -- clipboard -----------------------------------------------------------------
# in copy mode, copying selection also copies to the OS clipboard
# - true
# - false (default)
# - disabled
# on Linux, this requires xsel, xclip or wl-copy
tmux_conf_copy_to_os_clipboard=false
# -- urlscan -------------------------------------------------------------------
# options passed to urlscan
tmux_conf_urlscan_options="--compact --dedupe"
# -- user customizations -------------------------------------------------------
# this is the place to override or undo settings
# increase history size
#set -g history-limit 10000
# start with mouse mode enabled
#set -g mouse on
# force Vi mode
# really you should export VISUAL or EDITOR environment variable, see manual
#set -g status-keys vi
#set -g mode-keys vi
# replace C-b by C-a instead of using both prefixes
# set -gu prefix2
# unbind C-a
# unbind C-b
# set -g prefix C-a
# bind C-a send-prefix
# if you don't want Oh my tmux! to alter a binding or a setting, use #!important
# bind c new-window -c '#{pane_current_path}' #!important
# display a message after toggling mouse support
bind m run "cut -c3- '#{TMUX_CONF}' | sh -s _toggle_mouse" \; display 'mouse #{?#{mouse},on,off}'
# move status line to top
#set -g status-position top
# -- tpm -----------------------------------------------------------------------
# while I don't use tpm myself, many people requested official support so here
# is a seamless integration that automatically installs plugins in parallel
# whenever a plugin introduces a variable to be used in 'status-left' or
# 'status-right', you can use it in 'tmux_conf_theme_status_left' and
# 'tmux_conf_theme_status_right' variables.
# by default, launching tmux will update tpm and all plugins
# - true (default)
# - false
tmux_conf_update_plugins_on_launch=true
# by default, reloading the configuration will update tpm and all plugins
# - true (default)
# - false
tmux_conf_update_plugins_on_reload=true
# by default, reloading the configuration will uninstall tpm and plugins when no
# plugins are enabled
# - true (default)
# - false
tmux_conf_uninstall_plugins_on_reload=true
# /!\ the tpm bindings differ slightly from upstream:
# - installing plugins: <prefix> + I
# - uninstalling plugins: <prefix> + Alt + u
# - updating plugins: <prefix> + u
# /!\ do not add set -g @plugin 'tmux-plugins/tpm'
# /!\ do not add run '~/.tmux/plugins/tpm/tpm'
# /!\ the 'set -g @tpm_plugins' syntax is not supported
# to enable a plugin, use the 'set -g @plugin' syntax:
# visit https://github.com/tmux-plugins for available plugins
#set -g @plugin 'tmux-plugins/tmux-copycat'
#set -g @plugin 'tmux-plugins/tmux-cpu'
#set -g @plugin 'tmux-plugins/tmux-resurrect'
#set -g @plugin 'tmux-plugins/tmux-continuum'
#set -g @continuum-restore 'on'
# -- custom variables ----------------------------------------------------------
# to define a custom #{foo} variable, define a POSIX shell function between the
# '# EOF' and the '# "$@"' lines. Please note that the opening brace { character
# must be on the same line as the function name otherwise the parse won't detect
# it.
#
# then, use #{foo} in e.g. the 'tmux_conf_theme_status_left' or the
# 'tmux_conf_theme_status_right' variables.
# ------------------------------------------------------------------------------
# # /!\ do not remove the following line
# EOF
#
# # /!\ do not "uncomment" the functions: the leading "# " characters are needed
#
# # usage: #{weather}
# weather() { # see https://github.com/chubin/wttr.in#one-line-output
# curl -f -s -m 2 'wttr.in?format=3' || printf '\n' # /!\ make sure curl is installed
# sleep 900 # sleep for 15 minutes, throttle network requests whatever the value of status-interval
# }
#
# # usage: #{online}
# online() {
# ping -c 1 1.1.1.1 >/dev/null 2>&1 && printf '✔' || printf '✘'
# }
#
# # usage: #{wan_ip_v4}
# wan_ip_v4() {
# curl -f -s -m 2 -4 ifconfig.me
# sleep 300 # sleep for 5 minutes, throttle network requests whatever the value of status-interval
# }
#
# # usage: #{wan_ip_v6}
# wan_ip_v6() {
# curl -f -s -m 2 -6 ifconfig.me
# sleep 300 # sleep for 5 minutes, throttle network requests whatever the value of status-interval
# }
#
# # usage: #{github_stars}, #{github_stars tmux/tmux}, ...
# github_stars() {
# repository=${1##*https://github.com/}
# repository=${repository%% *}
# repository=${repository%%.git}
# url="https://api.github.com/repos/${repository:-gpakosz/.tmux}"
# curl -s "$url" | perl -MJSON::PP=decode_json -CO -0777 -E '$response = decode_json(readline *STDIN); say ($response->{stargazers_count})'
# sleep 300 # sleep for 5 minutes, throttle network requests whatever the value of status-interval
# }
#
# "$@"
# # /!\ do not remove the previous line
# # do not write below this line

View File

@ -1,18 +0,0 @@
Copyright 2012— Gregory Pakosz
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,13 +0,0 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

View File

@ -1,442 +0,0 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset=".logo/logomark+wordmark.svg">
<source media="(prefers-color-scheme: dark)" srcset=".logo/logomark+wordmark.svg">
<img alt="Oh my tmux! logo and wordmark" src=".logo/logomark+wordmark.svg">
</picture>
</p>
˗ˏˋ ★ ˎˊ˗ My self-contained, pretty and versatile tmux configuration, made with ❤️ ˗ˏˋ ★ ˎˊ˗
<p align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://cloud.githubusercontent.com/assets/553208/19740585/85596a5a-9bbf-11e6-8aa1-7c8d9829c008.gif">
<source media="(prefers-color-scheme: dark)" srcset="https://cloud.githubusercontent.com/assets/553208/19740585/85596a5a-9bbf-11e6-8aa1-7c8d9829c008.gif">
<img alt="Oh my tmux! in action" src="https://cloud.githubusercontent.com/assets/553208/19740585/85596a5a-9bbf-11e6-8aa1-7c8d9829c008.gif">
</picture>
</p>
Installation
------------
**Requirements:**
- tmux **`>= 2.6`** running on Linux, macOS, OpenBSD, Windows (WSL or Cygwin)
- awk, perl (with Time::HiRes support), grep, and sed
- Outside of tmux, the `TERM` environment variable must be set to
`xterm-256color`
⚠️ Before installing, you may want to backup your existing configuration.
You can install Oh my tmux! at any of the following locations:
- `~`
- `$XDG_CONFIG_HOME/tmux`
- `~/.config/tmux`
**Automatic installation**
Copy the following command and paste it in your terminal.
```
curl -fsSL "https://github.com/gpakosz/.tmux/raw/refs/heads/master/install.sh#$(date +%s)" | bash
```
**Manual installation in `~`**
```
$ cd
$ git clone --single-branch https://github.com/gpakosz/.tmux.git
$ ln -s -f .tmux/.tmux.conf
$ cp .tmux/.tmux.conf.local .
```
**Manual installation in `$XDG_CONFIG_HOME/tmux`**
```
$ git clone --single-branch https://github.com/gpakosz/.tmux.git "/path/to/oh-my-tmux"
$ mkdir -p "$XDG_CONFIG_HOME/tmux"
$ ln -s /path/to/oh-my-tmux/.tmux.conf "$XDG_CONFIG_HOME/tmux/tmux.conf"
$ cp /path/to/oh-my-tmux/.tmux.conf.local "$XDG_CONFIG_HOME/tmux/tmux.conf.local"
```
**Manual installation `~/.config/tmux`**
```
$ git clone --single-branch https://github.com/gpakosz/.tmux.git "/path/to/oh-my-tmux"
$ mkdir -p ~/.config/tmux
$ ln -s /path/to/oh-my-tmux/.tmux.conf ~/.config/tmux/tmux.conf
$ cp /path/to/oh-my-tmux/.tmux.conf.local ~/.config/tmux/tmux.conf.local
```
⚠️ When installing `$XDG_CONFIG_HOME/tmux` or `~/.config/tmux`, the configuration
file names don't have a leading `.` character.
🚨 **You should never alter the main `.tmux.conf` or `tmux.conf` file. If you do,
you're on your own. Instead, every customization should happen in your
`.tmux.conf.local` or `tmux.conf.local` customization file copy.**
If you're a Vim user, setting the `VIUAL` or `EDITOR` environment variable to
`vim` will enable and further customize the `vi-style` key bindings (see tmux
manual).
If you're new to tmux, I recommend you to read the [tmux getting started
guide][getting-started], as well as the [tmux 3: Productive Mouse-Free
Development][bhtmux3] book by [@bphogan].
Now proceed to [adjust] your `.local` customization file copy.
[getting-started]: https://github.com/tmux/tmux/wiki/Getting-Started
[bhtmux3]: https://pragprog.com/titles/bhtmux3/tmux-3/
[@bphogan]: https://bphogan.com/
[adjust]: #configuration
Troubleshooting
---------------
- **I believe something's not quite right**
Please, try make sure no tmux client or server process is currently running.
Then launch tmux with:
```
$ tmux -f /dev/null -L test
```
Which launches a new tmux client/server pair without loading any
configuration.
If the issue is still reproducing, please reach out to the tmux project for
support.
Otherwise, please open an issue describing what doesn't work and I'll do my
best to address it.
- **I tried to used `set`, `bind` and `unbind` in my `.local` customization
file, but Oh my tmux! overwrites my preferences**
When that happens append `#!important` to the line:
```
bind c new-window -c '#{pane_current_path}' #!important
```
```
set -g default-terminal "screen-256color" #!important
```
- **Status line is broken and/or gets duplicated at the bottom of the screen**
This could happen on Linux when the distribution provides a version of glib
that received Unicode 9.0 upgrades (glib `>= 2.50.1`) while providing a
version of glibc that didn't (glibc `< 2.26`). You may also configure
`LC_CTYPE` to use an `UTF-8` locale. Typically VTE based terminal emulators
rely on glib's `g_unichar_iswide()` function while tmux relies on glibc's
`wcwidth()` function. When these two functions disagree, display gets messed
up.
This can also happen on macOS when using iTerm2 and "Use Unicode version 9
character widths" is enabled in `Preferences... > Profiles > Text`
For that reason, the sample `.local` customization file stopped using
Unicode characters for which width changed in between Unicode 8.0 and 9.0
standards, as well as Emojis.
- **I installed Powerline and/or (patched) fonts but I can't see the Powerline
symbols**
**🤯 Please realize that you don't need to install [Powerline].**
You only need fonts patched with Powerline symbols or the standalone
`PowerlineSymbols.otf` font.
Then make sure your `.local` customization file copy uses the [Powerline
code points] for the
`tmux_conf_theme_left_separator_main`,
`tmux_conf_theme_left_separator_sub`,
`tmux_conf_theme_right_separator_main`
and `tmux_conf_theme_right_separator_sub` variables.
[Powerline]: https://github.com/Lokaltog/powerline
[Powerline code points]: #enabling-the-powerline-look
Features
--------
- `C-a` acts as secondary prefix, while keeping default `C-b` prefix
- Visual theme inspired by [Powerline][]
- [Maximize any pane to a new window with `<prefix> +`][maximize-pane]
- Mouse mode toggle with `<prefix> m`
- Laptop battery status line information
- Uptime status line information
- Optional highlight of focused pane
- Configurable new sessions, windows and panes behavior (to optionally retain
the current path)
- SSH/Mosh aware username and hostname status line information
- SSH/Mosh aware pane splitting (with automatic reconnection to the remote
server)
- Copy to OS clipboard (needs `xsel`, `xclip`, or `wl-copy` on Linux)
- Support for 4-digit hexadecimal Unicode characters
- [PathPicker][] integration, if available
- [Urlscan][] (preferred) or [Urlview][] integration, if available
[maximize-pane]: http://pempek.net/articles/2013/04/14/maximizing-tmux-pane-new-window/
[PathPicker]: https://facebook.github.io/PathPicker/
[Urlview]: https://packages.debian.org/stable/misc/urlview
[Urlscan]: https://github.com/firecat53/urlscan
The "Maximize any pane to a new window with `<prefix> +`" feature is different
from the builtin `resize-pane -Z` command, as it allows you to further split a maximized
pane. It's also more flexible by allowing you to maximize a pane to a new
window, then change window, then go back and the pane is still in maximized
state in its own window. You can then minimize a pane by using `<prefix> +`
either from the source window or the maximized window.
<p align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://cloud.githubusercontent.com/assets/553208/9890858/ee3c0ca6-5c02-11e5-890e-05d825a46c92.gif">
<source media="(prefers-color-scheme: dark)" srcset="https://cloud.githubusercontent.com/assets/553208/9890858/ee3c0ca6-5c02-11e5-890e-05d825a46c92.gif">
<img alt="Maximizing a pane" src="https://cloud.githubusercontent.com/assets/553208/9890858/ee3c0ca6-5c02-11e5-890e-05d825a46c92.gif">
</picture>
</p>
Mouse mode allows you to set the active window, set the active pane, resize
panes and automatically switches to copy-mode to select text.
<p align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://cloud.githubusercontent.com/assets/553208/9890797/8dffe542-5c02-11e5-9c06-a25b452e6fcc.gif">
<source media="(prefers-color-scheme: dark)" srcset="https://cloud.githubusercontent.com/assets/553208/9890797/8dffe542-5c02-11e5-9c06-a25b452e6fcc.gif">
<img alt="Mouse mode" src="https://cloud.githubusercontent.com/assets/553208/9890797/8dffe542-5c02-11e5-9c06-a25b452e6fcc.gif">
</picture>
</p>
Bindings
--------
tmux may be controlled from an attached client by using a key combination of a
prefix key, followed by a command key. This configuration uses `C-a` as a
secondary prefix while keeping `C-b` as the default prefix. In the following
list of key bindings:
- `<prefix>` means you have to either hit <kbd>Ctrl</kbd> + <kbd>a</kbd> or <kbd>Ctrl</kbd> + <kbd>b</kbd>
- `<prefix> c` means you have to hit <kbd>Ctrl</kbd> + <kbd>a</kbd> or <kbd>Ctrl</kbd> + <kbd>b</kbd> followed by <kbd>c</kbd>
- `<prefix> C-c` means you have to hit <kbd>Ctrl</kbd> + <kbd>a</kbd> or <kbd>Ctrl</kbd> + <kbd>b</kbd> followed by <kbd>Ctrl</kbd> + <kbd>c</kbd>
This configuration uses the following bindings:
- `<prefix> e` opens the `.local` customization file copy with the editor
defined by the `VISUAL` or `EDITOR` environment variable (defaults to `vim`
when empty)
- `<prefix> r` reloads the configuration
- `C-l` clears both the screen **and** the tmux history
- `<prefix> C-c` creates a new session
- `<prefix> C-f` lets you switch to another session by name
- `<prefix> C-h` and `<prefix> C-l` let you navigate windows (default
`<prefix> n` is unbound and `<prefix> p` is repurposed)
- `<prefix> Tab` brings you to the last active window
- `<prefix> -` splits the current pane vertically
- `<prefix> _` splits the current pane horizontally
- `<prefix> h`, `<prefix> j`, `<prefix> k` and `<prefix> l` let you navigate
panes ala Vim
- `<prefix> H`, `<prefix> J`, `<prefix> K`, `<prefix> L` let you resize panes
- `<prefix> <` and `<prefix> >` let you swap panes
- `<prefix> +` maximizes the current pane to a new window
- `<prefix> m` toggles mouse mode on or off
- `<prefix> U` launches Urlscan (preferred) or Urlview, if available
- `<prefix> F` launches Facebook PathPicker, if available
- `<prefix> Enter` enters copy-mode
- `<prefix> b` lists the paste-buffers
- `<prefix> p` pastes from the top paste-buffer
- `<prefix> P` lets you choose the paste-buffer to paste from
Additionally, `copy-mode-vi` matches [my own Vim configuration]
[my own Vim configuration]: https://github.com/gpakosz/.vim.git
Bindings for `copy-mode-vi`:
- `v` begins selection / visual mode
- `C-v` toggles between blockwise visual mode and visual mode
- `H` jumps to the start of line
- `L` jumps to the end of line
- `y` copies the selection to the top paste-buffer
- `Escape` cancels the current operation
It's also possible to preserve the tmux stock bindings by setting the
`tmux_conf_preserve_stock_bindings` variable to `true` in your `.local`
customization file copy.
Configuration
-------------
While this configuration tries to bring sane default settings, you may want to
customize it further to your needs.
🚨 Again, you should never alter the main `.tmux.conf` or `tmux.conf` file.
If you do, you're on your own.
Please refer to the sample `.local` customization file to know more about the
variables that allow you to alter different behaviors. Upon successful
installation, pressing `<prefix> e` will open your `.local` customization file
copy with the editor defined by the `VISUAL` or `EDITOR` environment variable
(defaults to `vim` when empty).
### Enabling the Powerline look
Powerline originated as a status-line plugin for Vim. Its popular eye-catching
look is based on the use of special symbols:
<p align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/55afd317-150b-42f0-9ef3-fa619be7b160">
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/55afd317-150b-42f0-9ef3-fa619be7b160">
<img alt="Powerline symbols" src="https://github.com/user-attachments/assets/55afd317-150b-42f0-9ef3-fa619be7b160">
</picture>
</p>
To make use of these symbols, there are several options:
- Use a font that already bundles those: this is the case of the [Source Code
Pro][source code pro] font
- Use a [pre-patched font][powerline patched fonts]
- Use your preferred font along with the standalone [Powerline font][powerline
font] (that only contains the Powerline symbols): [this highly depends on
your operating system and your terminal emulator][terminal support], for
instance here's a screenshot of iTerm2 configured to use
`PowerlineSymbols.otf` for non ASCII symbols:
<p align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/553208/62243890-8232f500-b3de-11e9-9b8c-51a5d38bdaa8.png">
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/553208/62243890-8232f500-b3de-11e9-9b8c-51a5d38bdaa8.png">
<img alt="iTerm2 + Powerline font" src="https://user-images.githubusercontent.com/553208/62243890-8232f500-b3de-11e9-9b8c-51a5d38bdaa8.png">
</picture>
</p>
[source code pro]: https://github.com/adobe-fonts/source-code-pro/releases/latest
[powerline patched fonts]: https://github.com/powerline/fonts
[powerline font]: https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
[terminal support]: http://powerline.readthedocs.io/en/master/usage.html#usage-terminal-emulators
Then edit your `.local` customization file copy (with `<prefix> e`) and adjust
the following variables:
```
tmux_conf_theme_left_separator_main='\uE0B0'
tmux_conf_theme_left_separator_sub='\uE0B1'
tmux_conf_theme_right_separator_main='\uE0B2'
tmux_conf_theme_right_separator_sub='\uE0B3'
```
The [Powerline manual] contains further details on how to install fonts
containing the Powerline symbols.
[Powerline manual]: http://powerline.readthedocs.org/en/latest/installation.html#fonts-installation
### Configuring the status line
Edit your `.local` customization file copy (`<prefix> e`) and adjust the
`tmux_conf_theme_status_left` and `tmux_conf_theme_status_right` variables to
your liking.
This configuration supports the following builtin variables:
- `#{battery_bar}`: horizontal battery charge bar
- `#{battery_hbar}`: 1 character wide, horizontal battery charge bar
- `#{battery_vbar}`: 1 character wide, vertical battery charge bar
- `#{battery_percentage}`: battery percentage
- `#{battery_status}`: is battery charging or discharging?
- `#{circled_session_name}`: circled session number (from ⓪) to ⑳)
- `#{hostname}`: SSH/Mosh aware hostname information
- `#{hostname_ssh}`: SSH/Mosh aware hostname information, blank when not
connected to a remote server through SSH/Mosh
- `#{loadavg}`: load average
- `#{pairing}`: is the current session attached to more than one client?
- `#{pretty_pane_current_path}`: prettified `#{pane_current_path}` when its
length is too long
- `#{prefix}`: is prefix being depressed?
- `#{root}`: is the current user root?
- `#{synchronized}`: are the panes synchronized?
- `#{uptime_y}`: uptime years
- `#{uptime_d}`: uptime days, modulo 365 when `#{uptime_y}` is used
- `#{uptime_h}`: uptime hours
- `#{uptime_m}`: uptime minutes
- `#{uptime_s}`: uptime seconds
- `#{username}`: SSH/Mosh aware username information
- `#{username_ssh}`: SSH aware username information, blank when not connected
to a remote server through SSH/Mosh
Beside the variables mentioned above, the `tmux_conf_theme_status_left` and
`tmux_conf_theme_status_right` variables support the usual tmux syntax, e.g.
using `#()` to call an external command that inserts weather information
provided by [wttr.in]:
```
tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #(curl -m 1 wttr.in?format=3 2>/dev/null; sleep 900) , %R , %d %b | #{username}#{root} | #{hostname} '
```
The `sleep 900` call makes sure the network request is issued at most every 15
minutes whatever the value of `status-interval`.
<p align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/553208/52175490-07797c00-27a5-11e9-9fb6-42eec4fe4188.png">
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/553208/52175490-07797c00-27a5-11e9-9fb6-42eec4fe4188.png">
<img alt="Weather information from wttr.in" src="https://user-images.githubusercontent.com/553208/52175490-07797c00-27a5-11e9-9fb6-42eec4fe4188.png">
</picture>
</p>
[wttr.in]: https://github.com/chubin/wttr.in#one-line-output
💡 You can also define your own custom variables by defining your own POSIX
shell functions, see the sample `.local` customization file for instructions.
Finally, remember that `tmux_conf_theme_status_left` and
`tmux_conf_theme_status_right` end up being given to tmux as `status-left` and
`status-right` which means they're passed through `strftime()`. As such, the `%`
character has a special meaning and needs to be escaped by doubling it, e.g.
```
tmux_conf_theme_status_right='#(echo foo %% bar)'
```
See also `man 3 strftime`.
### Using TPM plugins
This configuration comes with built-in [TPM] support:
- Use the `set -g @plugin ...` syntax to enable a plugin
- Whenever a plugin introduces a variable to be used in `status-left` or
`status-right`, you can use it in the `tmux_conf_theme_status_left` and
`tmux_conf_theme_status_right` variables, see instructions above 👆
- ⚠️ Do not add `set -g @plugin 'tmux-plugins/tpm'` to any configuration file
- ⛔️ Do not add `run '~/.tmux/plugins/tpm/tpm'` to any configuration file
⚠️ The TPM bindings differ slightly from upstream:
- Installing plugins: `<prefix> + I`
- Uninstalling plugins: `<prefix> + Alt + u`
- Updating plugins: `<prefix> + u`
See the sample `.local` customization file for further instructions.
[TPM]: https://github.com/tmux-plugins/tpm
### Using Oh my tmux! on Windows
<p align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/7f84a687-fb4d-4817-a445-419e63ccfac5">
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/7f84a687-fb4d-4817-a445-419e63ccfac5">
<img alt="Windows Terminal + WSL" src="https://github.com/user-attachments/assets/7f84a687-fb4d-4817-a445-419e63ccfac5">
</picture>
</p>
⚠️ I don't recommend running this configuration with [Cygwin] anymore. Forking
under Cygwin is extremely slow and this configuration issues a fair amount
`run-shell` commands under the hood. As such, you will experience high CPU
usage.
Instead I recommend [Windows Subsystem for Linux][WSL] along with [Windows
Terminal]. As an alternative, you may also consider using [Mintty as a terminal
for WSL][wsltty].
[Cygwin]: https://www.cygwin.com
[WSL]: https://learn.microsoft.com/en-us/windows/wsl
[wsltty]: https://github.com/mintty/wsltty
[Windows Terminal]: https://aka.ms/terminal

View File

@ -1,189 +0,0 @@
#!/bin/bash
# Oh my tmux!
# 💛🩷💙🖤❤️🤍
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
#
# ------------------------------------------------------------------------------
# 🚨 PLEASE REVIEW THE CONTENT OF THIS FILE BEFORE BLINDING PIPING TO CURL
# ------------------------------------------------------------------------------
{
if [ ${EUID:-$(id -u)} -eq 0 ]; then
printf '❌ Do not execute this script as root!\n' >&2 && exit 1
fi
if [ -z "$BASH_VERSION" ]; then
printf '❌ This installation script requires bash\n' >&2 && exit 1
fi
if ! tmux -V >/dev/null 2>&1; then
printf '❌ tmux is not installed\n' >&2 && exit 1
fi
is_true() {
case "$1" in
true|yes|1)
return 0
;;
*)
return 1
;;
esac
}
if ! is_true "$PERMISSIVE" && [ -n "$TMUX" ]; then
printf '❌ tmux is currently running, please terminate the server\n' >&2 && exit 1
fi
install() {
printf '🎢 Installing Oh my tmux! Buckle up!\n' >&2
printf '\n' >&2
now=$(date +'%Y%d%m%S')
for dir in "${XDG_CONFIG_HOME:-$HOME/.config}/tmux" "$HOME/.tmux"; do
if [ -d "$dir" ]; then
printf '⚠️ %s directory exists, making a backup → %s\n' "${dir/#"$HOME"/'~'}" "${dir/#"$HOME"/'~'}.$now" >&2
if ! is_true "$DRY_RUN"; then
mv "$dir" "$dir.$now"
fi
fi
done
for conf in "$HOME/.tmux.conf" \
"$HOME/.tmux.conf.local" \
"${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf" \
"${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf.local"; do
if [ -f "$conf" ]; then
if [ -L "$conf" ]; then
printf '⚠️ %s symlink exists, removing → 🗑️\n' "${conf/#"$HOME"/'~'}" >&2
if ! is_true "$DRY_RUN"; then
rm -f "$conf"
fi
else
printf '⚠️ %s file exists, making a backup -> %s\n' "${conf/#"$HOME"/'~'}" "${conf/#"$HOME"/'~'}.$now" >&2
if ! is_true "$DRY_RUN"; then
mv "$conf" "$conf.$now"
fi
fi
fi
done
if [ -d "${XDG_CONFIG_HOME:-$HOME/.config}" ]; then
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/tmux"
TMUX_CONF="${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf"
else
TMUX_CONF="$HOME/.tmux.conf"
fi
TMUX_CONF_LOCAL="$TMUX_CONF.local"
OH_MY_TMUX_CLONE_PATH="${XDG_DATA_HOME:-$HOME/.local/share}/tmux/oh-my-tmux"
if [ -d "$OH_MY_TMUX_CLONE_PATH" ]; then
printf '⚠️ %s exists, making a backup\n' "${OH_MY_TMUX_CLONE_PATH/#"$HOME"/'~'}" >&2
printf '%s → %s\n' "${OH_MY_TMUX_CLONE_PATH/#"$HOME"/'~'}" "${OH_MY_TMUX_CLONE_PATH/#"$HOME"/'~'}.$now" >&2
if ! is_true "$DRY_RUN"; then
mv "$OH_MY_TMUX_CLONE_PATH" "$OH_MY_TMUX_CLONE_PATH.$now"
fi
fi
printf '\n'
printf '✅ Using %s\n' "${OH_MY_TMUX_CLONE_PATH/#"$HOME"/'~'}" >&2
printf '✅ Using %s\n' "${TMUX_CONF/#"$HOME"/'~'}" >&2
printf '✅ Using %s\n' "${TMUX_CONF_LOCAL/#"$HOME"/'~'}" >&2
printf '\n'
OH_MY_TMUX_REPOSITORY=${OH_MY_TMUX_REPOSITORY:-https://github.com/gpakosz/.tmux.git}
printf '⬇️ Cloning Oh my tmux! repository...\n' >&2
if ! is_true "$DRY_RUN"; then
mkdir -p "$(dirname "$OH_MY_TMUX_CLONE_PATH")"
if ! git clone -q --single-branch "$OH_MY_TMUX_REPOSITORY" "$OH_MY_TMUX_CLONE_PATH"; then
printf '❌ Failed\n' >&2 && exit 1
fi
fi
printf '\n'
if is_true "$DRY_RUN" || ln -s -f "$OH_MY_TMUX_CLONE_PATH/.tmux.conf" "$TMUX_CONF"; then
printf '✅ Symlinked %s → %s\n' "${TMUX_CONF/#"$HOME"/'~'}" "${OH_MY_TMUX_CLONE_PATH/#"$HOME"/'~'}/.tmux.conf" >&2
fi
if is_true "$DRY_RUN" || cp "$OH_MY_TMUX_CLONE_PATH/.tmux.conf.local" "$TMUX_CONF_LOCAL"; then
printf '✅ Copied %s → %s\n' "${OH_MY_TMUX_CLONE_PATH/#"$HOME"/'~'}/.tmux.conf.local" "${TMUX_CONF_LOCAL/#"$HOME"/'~'}" >&2
fi
tmux() {
${TMUX_PROGRAM:-tmux} ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} "$@"
}
if ! is_true "$DRY_RUN" && [ -n "$TMUX" ]; then
tmux set-environment -g TMUX_CONF "$TMUX_CONF"
tmux set-environment -g TMUX_CONF_LOCAL "$TMUX_CONF_LOCAL"
tmux source "$TMUX_CONF"
fi
if [ -n "$TMUX" ]; then
printf '\n' >&2
printf '⚠️ Installed Oh my tmux! while tmux was running...\n' >&2
printf '→ Existing sessions have outdated environment variables\n' >&2
printf ' • TMUX_CONF\n' >&2
printf ' • TMUX_CONF_LOCAL\n' >&2
printf ' • TMUX_PROGRAM\n' >&2
printf ' • TMUX_SOCKET\n' >&2
printf '→ Some other things may not work 🤷\n' >&2
fi
printf '\n' >&2
printf '🎉 Oh my tmux! successfully installed 🎉\n' >&2
}
if [ -p /dev/stdin ]; then
printf '✋ STOP\n' >&2
printf ' 🤨 It looks like you are piping commands from the internet to your shell!\n' >&2
printf " 🙏 Please take the time to review what's going to be executed...\n" >&2
(
printf '\n'
self() {
printf '# Oh my tmux!\n'
printf '# 💛🩷💙🖤❤️🤍\n'
printf '# https://github.com/gpakosz/.tmux\n'
printf '\n'
declare -f install
}
while :; do
printf ' Do you want to review the content? [Yes/No/Cancel] > ' >&2
read -r answer >&2
case $(printf '%s\n' "$answer" | tr '[:upper:]' '[:lower:]') in
y|yes)
case "$(command -v bat)${VISUAL:-${EDITOR}}" in
*bat*)
self | LESS='' bat --paging always --file-name install.sh
;;
*vim*) # vim, nvim, neovim ... compatible
self | ${VISUAL:-${EDITOR}} -c ':set syntax=tmux' -R -
;;
*)
tput smcup
clear
self | LESS='-R' ${PAGER:-less}
tput rmcup
;;
esac
break
;;
n|no)
break
;;
c|cancel)
printf '\n'
printf '⛔️ Installation aborted...\n' >&2 && exit 1
;;
esac
done
) < /dev/tty || exit 1
printf '\n'
fi
install
}

1
libs/external/tmux vendored Submodule

@ -0,0 +1 @@
Subproject commit 615c27c11789948df2db09e113e882f82dfb3e1c