Skip to main content

Module install

Module install 

Source
Expand description

Putting taimux on PATH and binding the key.

This is the part that writes to a real configuration file, so the rules it follows are about not making a mess of somebody’s tmux config:

  • Idempotent by the command string. A past install’s block is stripped from every file it could have touched before a new one is written, or a reinstall registers the binding twice and the popup opens twice.
  • Oh My Tmux gets .tmux.conf.local, never .tmux.conf. That file is both configuration AND a shell script (its _apply_configuration is run through cut | sh), so appending raw config to the wrong one breaks every reload.
  • Inside the “user customizations” section where there is one, because in Oh My Tmux that section sits inside a heredoc and is therefore safe from that pass.
  • A plugin-manager checkout is left alone entirely. There the plugin entry point binds the keys on every launch and reload, so writing to the config would be a second, stale copy of the same binding.
  • The bindings call the bare launcher name, never the checkout path, so moving the checkout does not break them.

Functions§

bind
taimux bind: bind the keys in the running server and write nothing.
bind_live
Bind the keys in the RUNNING server, and say what got bound.
block_for
The block itself: a marker line saying what it is, then one bind per key.
choose_conf
Which file to write to.
describe
How the two keys read in a sentence.
insert_block
Insert the block, under the “user customizations” heading where there is one.
install
taimux install: symlink the launcher and bind the key.
install_hooks
Register the hook for the turn boundaries, and for a tool having run.
is_oh_my_tmux
Is this an Oh My Tmux configuration?
plugin_checkout
Is this checkout owned by a plugin manager?
popup_cmd
#{pane_id} in there is inert on purpose: display-popup expands no format in the command it runs, so bare like this the shell drops it as a comment and the picker asks tmux which pane it was opened from. Quoting it would hand the picker the format itself as a string.
popup_geometry
How much of the client a popup takes: near-full on a small screen (a phone over ssh), 80% on a roomy terminal.
strip_block
Remove any block a past install added, under any of this tool’s former names.
tmux_opt
A tmux user option, or a default when it is not SET at all.