Muxi
Create dynamic shortcuts for your tmux sessions!
Install
Usage
)
Configuration
Lua
You can provide an init.lua
in one of the following locations:
$MUXI_CONFIG_PATH
$XDG_CONFIG_HOME/muxi/
~/.config/muxi/
Or run muxi config edit
to open it in your favorite $EDITOR
-- Optional: Use tmux <prefix> to define muxi's table (default: true)
muxi. = true
-- Optional: Muxi's table binding (default: "g"), will result in `<prefix>g`
muxi. = "g"
-- Optional: Uppercase letters will set the current session (default: false)
muxi. = false
-- Optional: Set current session path to current pane's path
muxi. = false
-- Optional bindings to be created on tmux's muxi table (Examples shown)
muxi. =
And start muxi
in your tmux.conf
:
if "type muxi" {
run -b "muxi init"
}
Tmux variables
You can alternatively define settings entirely from your tmux config:
# Optional settings (default values shown)
set -g @muxi-use-tmux-prefix 'on' # on|off
set -g @muxi-prefix 'g' # Any valid tmux key, like `M-Space`
set -g @muxi-uppercase-overrides 'off' # on|off
set -g @muxi-use-current-pane-path 'off' # on|off
# Init muxi
if "type muxi" {
# If you're going to define bindings on the muxi table, don't use `-b`
run "muxi init"
}
# Define bindings on the muxi table:
# <prefix>ge => Edit sessions in your editor
bind -T muxi e popup -w 76% -h 75% -b rounded -T " sessions " -E "muxi sessions edit -- +ZenMode -c 'nmap <silent> q :wqa<cr>'"
# TIP: Using the native tmux menu is a good alternative to the common workflow,
# it'll map your session bindings to the menu
bind 'f' run 'muxi sessions switch --tmux-menu'
Sessions
Running muxi sessions edit
will open your sessions.toml
file, which should look something like the following:
# <key> = { name = <session_name>, path = <session_path> }
= { = "dotfiles", = "~/.dotfiles" }
= { = "muxi", = "~/Sites/rust/muxi/" }
= { = "notes", = "~/Library/Mobile Documents/com~apple~CloudDocs/notes" }
This is the file that muxi
will use to generate your session bindings and keep state. After exiting your editor, muxi
will resync the sessions (same with your configuration!)