21

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 ...


18

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 ...


16

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 ...


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 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:...


13

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 ...


13

From the help zuw *zug* *zuw* zug Undo |zw| and |zg|, remove the word from the entry in 'spellfile'. Count used as with |zg|. zuW *zuG* *zuW* zuG Undo |zW| and |zG|, remove the word from the internal word list. Count used as with |zg|.


11

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@...


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 ...


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 ...


9

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 ...


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 ...


8

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 ...


8

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 ...


7

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/...


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

Here is a bit more complete answer to address this annoyance: " Force to use underline for spell check results augroup SpellUnderline autocmd! autocmd ColorScheme * \ highlight SpellBad \ cterm=Underline \ ctermfg=NONE \ ctermbg=NONE \ term=Reverse \ gui=Undercurl \ guisp=Red autocmd ColorScheme * \ ...


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....


6

Frame Challenge : Using Vim "Properly"1 autocmd is NOT the solution to filetype-dependent settings. It might seem like a good candidate at first, but Vim was built after the Unix philosophy of placing files in defined directory structure to affect behavior. Most vim users learn about vimrc first. But there are more (see :help rtp). What this means for the ...


6

Spellchecking inside tags has been requested some time ago (and apparently was a long outstanding Debian wishlist bug) and was enabled in the vim-xml syntax file since this commit. Just clone the runtime files inside your package directory and it should readily work. The soon to be awaited Vim 8.2 release already contains this commit and should then work ...


5

I don't know how to use a regex to spell checking, but you can highlight repeated words the way spell would: syn match SpellBad /\<\(\w\+\)\s\+\1\>/ (Yes, I like \ a lot. :P) This won't bring up foo foo when you look for badly spelled words (via [s or ]s, for example), but hopefully the quick visual feedback you get from the highlighting should be ...


5

You can add your own syntax rules to e.g. ~/.vim/after/syntax/tex.vim. In order to prevent spell checking inside a command such as \url, you can use the following code: syntax match texStatement '\\command' nextgroup=texMyCommand syntax region texMyCommand matchgroup=Delimiter start='{' end='}' contained contains=@NoSpell Here texStatement and Delimiter ...


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()...


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