Surprisingly effective writing autocomplete in vim


It bugged me that vim’s autocomplete was giving me useless autocomplete while I was writing the draft to another blog post. So I decided to fix it, which turned out to be pretty trivial.

I copied this to /usr/local/share/dict/common-words.

Then I opened up that file and deleted all words less than 5 letters long with the following command:

:g/\v^.{,5}$/d

Then I deleted all words made of letters on the home row with the command

:g/\v^[arstneio]{,7}$/d

In my autocommands file, I added the (rather ugly) command

autocmd Filetype md,mmd,txt,markdown,ghmarkdown,pandoc,mail,gitcommit,liquid setlocal dictionary+=/usr/local/share/dict/common-words

And then I set

autocmd Filetype md,mmd,txt,markdown,ghmarkdown,pandoc,mail,gitcommit,liquid setlocal complete+=k

And you’re done.

Related Posts

Random Thought: LC Theorem

I finally have an answer to "who's your favorite singer?"

My Top Tip for Helping People Get Started Programming

GPT-f

Random paper on angles

An Image is Worth 16x16 Words

Random stuff

Lossless Data Compression with Neural Networks by Fabrice Bellard

Downscaling Numerical Weather Models With GANs (My CI 2019 Paper)

Learning Differential Forms and Questions