Sync helix instances with tmux

Tags: @English

use the alias shx to signal autoreaload to tmux

cd ~/bin
ln -s /usr/bin/shx

config.toml:

[keys.insert]
A-W = ':write-all'
A-R = ':reload-all'

[keys.normal]
A-W = ':write-all'
A-R = ':reload-all'

tmux.conf:

bind -n M-H run-shell 'mux-select -L'
bind -n M-J run-shell 'mux-select -D'
bind -n M-K run-shell 'mux-select -U'
bind -n M-L run-shell 'mux-select -R'

mux-select

#!/bin/sh

tmux if -F \
    '#{==:#{pane_current_command},shx}' \
    'send-keys M-W; select-pane '$1 \
    'select-pane '$1

tmux if -F \
    '#{==:#{pane_current_command},shx}' \
    'send-keys M-R' &