mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-31 18:47:11 +00:00
26 lines
647 B
Bash
Executable File
26 lines
647 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# x-xterm-update-keybindings
|
|
# Updates $HOME/.dotfiles/docs/tmux.md with my keybindings.
|
|
|
|
# shellcheck source=./../../scripts/shared.sh
|
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
|
|
|
x-have tmux || {
|
|
msg_err "tmux not found" && exit 0
|
|
}
|
|
|
|
TMUX_KEYBINDINGS_DOCS="$DOTFILES/docs/tmux-keybindings.md"
|
|
|
|
CB="\n\`\`\`\n"
|
|
KB=$(tmux lsk -Tprefix -N | sed -e 's/^/ /;')
|
|
H="# tmux keybindings\n"
|
|
L="\nLeader: \`<ctrl><space>\`\n"
|
|
|
|
# Generalize expanded $HOME to "$HOME"
|
|
KB="${KB//$HOME/\$HOME}"
|
|
|
|
msg "Outputting tmux keybindings to $TMUX_KEYBINDINGS_DOCS"
|
|
echo -e "${H}${L}${CB}${KB}${CB}" > "$TMUX_KEYBINDINGS_DOCS"
|
|
msg_done "Done!"
|