mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 03:04:06 +00:00
27 lines
643 B
Bash
Executable File
27 lines
643 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
|
|
DOTFILES_SHARED_LOADED=""
|
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
|
|
|
have tmux || {
|
|
msg_err "tmux not found" && exit 0
|
|
}
|
|
|
|
TMUX_KEYBINDINGS_DOCS="$DOTFILES/docs/tmux-keybindings.md"
|
|
|
|
CB="\n\`\`\`\n"
|
|
KB=$(tmux list-keys)
|
|
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!"
|