feat!: refactor base, config, dfm and scripts

This commit is contained in:
2024-07-23 03:43:12 +03:00
parent adecceda7a
commit 1f2ca90ca5
36 changed files with 1543 additions and 897 deletions

View File

@@ -1,20 +1,28 @@
#!/usr/bin/env bash
# Create file containing key mappings for Neovim
# Usage: ./create-nvim-keymaps.sh
eval "$HOME/.dotfiles/scripts/shared.sh"
#
# shellcheck source=shared.sh
source "${DOTFILES}/config/shared.sh"
DEST="$HOME/.dotfiles/docs/nvim-keybindings.md"
main()
{
printf "# nvim keybindings\n";
printf "\n";
printf "\`\`\`txt";
} > "$DEST"
msg "Generating Neovim keybindings documentation"
NVIM_APPNAME="nvim-kickstart" nvim -c "redir! >> $DEST" -c 'silent verbose map' -c 'redir END' -c 'q'
{
printf "# nvim keybindings\n\n"
printf "\`\`\`txt\n"
} > "$DEST"
printf "\n\`\`\`\n\n- Generated on %s\n" "$(date)" >> "$DEST"
NVIM_APPNAME="nvim-kickstart" nvim -c "redir! >> $DEST" -c 'silent verbose map' -c 'redir END' -c 'q'
# Remove lines with "Last set from" from the file
sed -e '/^ Last set from/d' "$DEST" > "$DEST.tmp" && mv "$DEST.tmp" "$DEST"
printf "\n\`\`\`\n\n- Generated on %s\n" "$(date)" >> "$DEST"
# Remove lines with "Last set from" from the file
sed -e '/^ Last set from/d' "$DEST" > "${DEST}.tmp" && mv "${DEST}.tmp" "$DEST"
msg "Neovim keybindings documentation generated at $DEST"
}
main "$@"