From ec5dd2419877e19b4fd934669bd1ed5dcb7150c9 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 8 Dec 2022 13:39:40 +0100 Subject: [PATCH] nvim: Bootstrap spellfile if not existing Neovim sometimes errors out when enabling spelling without having all the necessary spellfiles available. This ensures on setting up the environment that a spellfile is downloaded. --- nvim/.config/sh/env.d/set-up-spellfile.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 nvim/.config/sh/env.d/set-up-spellfile.sh diff --git a/nvim/.config/sh/env.d/set-up-spellfile.sh b/nvim/.config/sh/env.d/set-up-spellfile.sh new file mode 100644 index 0000000..39eac18 --- /dev/null +++ b/nvim/.config/sh/env.d/set-up-spellfile.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env sh +# Set up a non-english spell dictionary if it doesn't exist yet. + +if [ ! -e "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/site/spell/de.utf-8.spl" ]; then + echo "Neovim spell dictionary not yet installed, downloading..." + mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/site/spell/" + wget -q 'https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl' -O "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/site/spell/de.utf-8.spl" + echo "Done." +fi + +