18

Problem specification

I would love to have a medical spell dictionary in vim. Currently, I have a lot of medical terms in my own personal English dictionary right now. However, using an official medical dictionary would be a superior solution.

What I tried

So I tried adding the following to my vimrc:

set spelllang=en_us,nl,medical

This line of code comes directly from the vim documentation.
It is findable under :help spl. (vim version 8.1).

I restarted vim and I got a message that it was not installed.

To resolve this, I ran :set spell to interactively down the spelling files.
No luck on that:

:set spell
Cannot find spell file for "medical" in utf-8
Do you want me to try downloading it? Y

Downloading medical.utf-8.spl...
:!curl 'http://ftp.vim.org/pub/vim/runtime/spell/medical.utf-8.spl' -L -o '/tmp/vYgP5zs/4.spl'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
"/tmp/vYgP5zs/4.spl" 9 lines, 314 character 
Could not find it, trying medical.ascii.spl...
:!curl 'http://ftp.vim.org/pub/vim/runtime/spell/medical.ascii.spl' -L -o '/tmp/vYgP5zs/4.spl'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
"/tmp/vYgP5zs/4.spl" 9 lines, 314 character 
Sorry, downloading failed
Warning: Cannot find word list "medical.utf-8.spl" or "medical.ascii.spl"

So I tried searching the relevant ftp.vim.org link, and indeed there are not listed there.

What is an alternative route to installing these medical spelling files?

3
  • 3
    You may be able to download a plain-text version of an actual medical dictionary or spelling list and use vim + :mkspell to create the files.
    – D. Ben Knoble
    Sep 6, 2021 at 19:30
  • 1
    This would be a very decent contribution if you want to create this spell file!!!
    – alec
    Sep 6, 2021 at 22:06
  • Thanks @alec and @ben! I used exactly your suggestions. It has been added down below such that others can benefit too.
    – melvio
    Sep 7, 2021 at 19:08

2 Answers 2

47

The "medical" spell file does not exist, it is just an example of a name that is longer than two characters. You would have to generate one yourself.

10
  • 17
    Thank you, Bram! I really appreciate that you made an account to help me out. I cannot express how honored I feel to get an answer from the author of Vim himself. Thank you for your contributions to mankind!
    – melvio
    Sep 6, 2021 at 18:43
  • 7
    @melvio You're probably the first one here on vi.se to get help from Bram :)
    – Maxim Kim
    Sep 6, 2021 at 18:51
  • 21
    Welcome to Vi and Vim, Bram! Glad to have you here.
    – D. Ben Knoble
    Sep 6, 2021 at 19:29
  • 7
    Hmm, how do we know he is Bram Moolenaar by the way?
    – Quasímodo
    Sep 7, 2021 at 11:16
  • 14
    This is the real Bram. I send him this spell file question in an email in his native language. He replied, from his official email, that he answered on vi.se too. Moreover, this answer is essentially an exact translation from the answer in his email.
    – melvio
    Sep 7, 2021 at 15:45
26

In response to Bram's answer, I have found, modified, and compiled a medical spell file that can be used with Vim.

I've made the full instructions and the source code available under a GPL3 license over here. However, I'll provide an abbreviated guide to installing the medical spell file here too.

How to install a medical spell file for vim

Step 1: On a Linux machine, the medical spell file can be downloaded as follows:

curl "https://raw.githubusercontent.com/melvio/medical-spell-files/main/spell/medical.utf-8.spl" --output "${HOME}/.vim/spell/medical.utf-8.spl"

Step 2: Add the medical dictionary to your vimrc. For example, by adding:

set spellang=en_us,medical

Step 3: Start your happy Vimming. Is your spell checking disabled by default? You can enable it by running the following command in vim:

:set spell

Found any issues? Feel free to edit my post and/or send me a PR/issue over here.


Thanks again Bram Moolenaar for providing the correct answer. And, thank you @D. Ben Knoble for providing me with the solution:

You may be able to download a plain-text version of an actual medical dictionary or spelling list and use vim +:mkspell to create the files.

1
  • 2
    Note: One can also add Plug 'melvio/medical-spell-files' in the right place if using Neovim. Aug 25, 2022 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.