Skip to content

Instantly share code, notes, and snippets.

@AndrewRadev
Created February 20, 2025 10:06
Show Gist options
  • Save AndrewRadev/d953bf9f97c283ddc32bd61cf211d026 to your computer and use it in GitHub Desktop.
Save AndrewRadev/d953bf9f97c283ddc32bd61cf211d026 to your computer and use it in GitHub Desktop.
Download a pair of spellfiles and convert them to Vim's
#!/bin/sh
# Adapted from:
# https://github.com/ficcdaf/academic.nvim/blob/83865969059b2aaea2e7afcebaa60085e965d9f8/scripts/generate-wordlist.sh
# Adjust to your home directory:
VIM_HOME="$HOME/.vim"
DOWNLOAD_TARGET="$VIM_HOME/spell/en-academic"
# The "unmunch" command comes with "hunspell":
unmunch <(curl -s https://raw.githubusercontent.com/emareg/acamedic/refs/heads/master/en-Academic.dic) \
<(curl -s https://raw.githubusercontent.com/emareg/acamedic/refs/heads/master/en-Academic.aff) \
> "$DOWNLOAD_TARGET"
# You can also run this `mkspell!` command directly in Vim:
echo "mkspell! $DOWNLOAD_TARGET" | vim -es
# This will create `~/.vim/spell/en-academic.utf8.spl`. To use it, add it to `spellang`:
# set spellang=en,en-academic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment