Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
17

To remove a word, try zuw and/or zug I've tried cmd + fing the spell man page for "remove word" but found nothing. For a cmd+f search, I have had more success searching only on "remove" :-) If you turn on spelling with setlocal spell spelllang=en_us then your long term dictionary is in your home directory. Mine is at: ~/.vim/spell/en.utf-8.add ...


15

The last misspelled word is not directly accessible, nor can the highlighting be queried. You have to retrieve the word before the cursor yourself, and spell-check that one separately. Fortunately, there's such spellbadword() function. The following sets up a trigger on each inserted key that checks the last word: autocmd CursorMovedI * if &spell &&...


14

The best way to set an option for a particular filetype is to use autocommands. Here you could add something like that in your .vimrc: autocmd FileType markdown setlocal spell This line will trigger the command setlocal spell when the filetype of a buffer is set as markdown. you can also use the autocommand based on the extension of the file you edit with ...


13

You can add custom syntax rules, and give them the @nospell keyword, this will tell Vim not to apply spell checking to this syntax match. For example: :syn match UrlNoSpell "\w\+:\/\/[^[:space:]]\+" contains=@NoSpell The above will work for text files, and some filetypes (such as markdown), but not for all filetypes. Note that I used a fairly simple regex ...


11

Here's something I didn't know until a little while ago: Macros can be recursive! That is, you can call a macro from within the same macro. So, here's the command: ggqq]s1z=@qq@q That is, gg Move to the beginning of the file qq Start recording the "q" macro ]s Find the next misspelled word 1z= Correct its spelling @q Call the "q" macro (we're still ...


11

The SpellBad highlighting group should allow you to configure the appearance of misspelled words. Let's say you want them to be red on yellow background. Then you could add the following code somewhere in your vimrc file or in your colorscheme file (but in any case after the colorscheme has set up the SpellBad group, otherwise it would override your ...


11

Vim uses the spl file to do the checks, and the spl file is generated from the add file. We can speculate on whether the spl file is portable across different machines and Vim versions, but it's easier (and safer) to re-generate it as needed. Now, the spl file is re-generated automatically when you add words to your local dictionary from within Vim, but ...


10

You can disable spell checking for syntax items by adding them to a cluster together with @NoSpell. You can read :help spell-syntax for some information and look at your tex syntax file which most likely contains several examples already. If you type :tabe $VIMRUNTIME/syntax/tex.vim you should get the tex syntax file in a new tab. If you then search /\c@...


10

The help states this: The plugin has a default place where to look for spell files, on the Vim ftp server. If you want to use another location or another protocol, set the g:spellfile_URL variable to the directory that holds the spell files. The netrw plugin is used for getting the file, look there for the specific syntax of the URL. Example: let g:...


10

The repository says it uses Vim's spellcheck, so you should be able edit your color file's SpellBad highlighting to do this. Something like: hi SpellBad ctermfg=red guifg=red You could also put these in your vimrc, but your color file is really the proper place for it. cterm is for terminal vim gui is for gVim The full set of options are cterm ctermbg ...


9

Alright, so I looked it up this way since I had Vim's source code lying around: $ cd ~/Documents/vim $ ack 'the the' ... runtime/doc/spell.txt 399:It can also be used to recognize "the the" and highlight it. 1206:"the the" in the .dic file: 1208: the the/! ~ 1463: REP the_the the ~ ... OK so Vim's documentation itself appears to explain the ...


8

Yes, you can use :spelldump. :spelld[ump] Open a new window and fill it with all currently valid words. Compound words are not included. Note: For some languages the result may be enormous, causing Vim to run out of memory. Vim will use the language file that you set with ...


8

I would recommend against automatically fixing every word that is marked wrong, for two reasons. First, you'll get a lot of false positives on things you meant to type, especially in more technical writing. You certainly can (and perhaps should) add these two your dictionary so that they're recognized and suggested. However, if you don't notice that they're ...


7

$ grep "'" /usr/share/dict/words | wc -l 26226 $ grep -i python /usr/share/dict/words Python Python's python python's pythons The problem is that all these words with apostrophes are actually in your dictionary file. So if you're okay with modifying your vim spelling dictionary, then do so: $ grep "'" /usr/share/dict/words | sed "s/'/’/g" >> ~/.vim/...


7

You can define syntax rule with the @NoSpell keyword. From :help :syn-spell :sy[ntax] spell [toplevel | notoplevel | default] This defines where spell checking is to be done for text that is not in a syntax item: toplevel: Text is spell checked. notoplevel: Text is not spell checked. default: When ...


7

Use zG. From :help zG *zG* zG Like "zg" but add the word to the internal word list |internal-wordlist|. and from :help internal-wordlist *internal-wordlist* The internal word list is used for all buffers where 'spell' is set. It is not stored, it is lost when you exit Vim. It ...


7

If your highlighting is like mine then that would be a SpellLocal error. SpellLocal Word that is recognized by the spellchecker as one that is used in another region. And... A word may be spelled differently in various regions. For example, English comes in (at least) these variants: en: all regions en_au: Australia ...


7

Vim finds the file you're referring to as the "master" file by searching for files with a particular naming scheme in the spell subdirectory within the paths specified by your runtimepath. (See :help spell-load) This is already working in your setup, though, so you don't need to worry about it. You can then have as many additional files as you like by ...


6

If I run :set spell, I get: spellfile#LoadFile(): There is no writable spell directory Shall I create /Users/adamharris/.nvim/spell (Y)es, [N]o: Select y Cannot find spell file for "en" in utf-8 Do you want me to try downloading it? (Y)es, [N]o: Select y, and it will download the file. In which directory do you want to write the file: 1. /Users/...


6

There's the 'spellcapcheck' option; from the help: Pattern to locate the end of a sentence. The following word will be checked to start with a capital letter. If not then it is highlighted with SpellCap hl-SpellCap (unless the word is also badly spelled). The default value is [.?!]\_[\])'" \t]\+, but it may be set when loading a spell file (to ...


6

You can use the spellbadword function: spellbadword([{sentence}]) ... With argument: The result is the first word in {sentence} that is badly spelled. If there are no spelling mistakes the result is an empty string. The return value is a list with two items: - The badly spelled word or an empty string. - The type of the ...


6

Here's what I came up with: Spell Rotate Features The '[ and '] marks are used to keep track of the text being worked on. Making a change elsewhere will effectively "accept" the suggested change. Accepts a count. Goes backwards using zp Repeatable using vim-repeat. Undo once to restore the original word regardless of how many suggestions have been cycled....


5

The syntax items within which Vim will highlight spelling mistakes are defined using the @Spell and @NoSpell clusters. See :help spell-syntax (and the rest of the :help spell and :help syntax files) for full details. The quick and dirty fix to get your desired result is to create a new file in your Vim config directory: .vim/after/syntax/html.vim with the ...


5

Looking at the spell_suggest() function in spell.c this doesn't seem possible with z=. After getting & displaying all the possible suggestions, it does: /* Ask for choice. */ selected = prompt_for_number(&mouse_used); prompt_for_number() lives in misc1.c, and does exactly what you would expect it to do: it prompts for a number (also see get_number()...


5

Most likely you've got some conflict with file syntax, which can be confirmed by turning that off: :syn off For example, by default in vim files (Such as your .vimrc) spell checking is only performed in comments.


5

First: This is not related to vim-lexical. Syntax rules define where spell checking should be done, and so the current behaviour is defined by the internal syntax plugin for LaTeX. The default syntax rule for tex command arguments allows spell checking. Some commands, e.g. \include{...}, are not spell checked. This is controlled by the @Spell and @NoSpell ...


5

What you can do is modify the ]s and [s motions to skip over SpellBad highlighted words. This is actually not very hard. With the spellbadword() function we can get information about the spell status of the current word: Example outputs of :echo spellbadword(): test: ['', ''] behavior (with en-gb locale): ['behavior', 'local'] qwe: ['qwe', 'bad'] So what ...


5

As @statox suggested, you can use the plugin I wrote: vimcorrect. I'll explain basically how it works, so if you want to reuse some part of it, you can. To focus on the next misspelled word I use directly ]s and [s as they jump to the next/previous match. I defined a custom match function to highlight the current word: matchadd('error', '\%'.line('.').'l'....


5

I answered pretty much the same question on Stack Overflow last week, and the short of it is that you can't do this. The best you can do is to use :set spelllang=en_gb,tr, so it checks both languages. Sorry :-( As for ignore these regions, this can be done by adding a new syntax group with contains=@NoSpell. See :help :syn-spell. Also see Is it possible ...


5

The first hint as to the purpose of these files is :h spell-sug-file: This file is used to find suggestions by their sound-a-like form quickly. At the cost of a lot of memory There are three types of files used in Vim's built-in spell checking tool: Dictionary Simple lists of correct/known words that are used to identify spelling errors. Vim scans ...


Only top voted, non community-wiki answers of a minimum length are eligible