I have noticed that vim spellcheck does not highlight/select text which is emphasized (i.e., italicized) or strongly emphasized (i.e., bold) in markdown.
For example,
The wuick brown fox jumps over the lazy dog
Vim spellcheck highlights wuick. I can also select this word using ]s and [s.
However when I type:
_The wuick brown fox jumps over the lazy dog_
wuick is not highlighted. While one may think that the highlight is not done since vim highlights the entire emphasized segment, even when I use ]s or [s to cycle through misspelt words I am not able to select wuick in the emphasized text. It is the same situation when I strongly emphasize the text as
**The wuick brown fox jumps over the lazy dog**
However when I take the cursor to wuick in the emphasized or strongly emphasized text, z= pops up the possible correct spellings for me to select from.
How can I turn on vim spellcheck highlighting and selection for emphasized and strongly emphasized text?
Added information (2021-01-21)
as suggested in the comments below maybe there was a problem with my vimrc. I ran vi with the -u NONE -U NONE -N flags and then vi spell check was able to highlight wuick in all three of the above sentences. Thinking that there was a problem with my vimrc, I ran vi as usual but with an empty vimrc file. However, this recreated the above issue of vi spell check not highlighting the misspelt wuick in the emphasised and strongly emphasised text and also not cycling through them with [s and ]s.
I then tried the following test:
I opened a new buffer in vi (with the empty vimrc file) and typed the following sentences fresh
The wuick brown fox jumps over the lazy dog
_The wuick brown fox jumps over the lazy dog_
**The wuick brown fox jumps over the lazy dog**
When I turned on spell check with set spell the three misspellings of wuick were highlighted and I could cycle through them with ]s and [s.
However the moment I saved the file with the command :sav test.md vi spell check failed to highlight the latter two occurrences of wuick and also did not cycle through them with ]s and [s
This suggests to me that there is something about how vi detects markdown files that interferes with vi spell check.
Will be grateful if someone else can redo the test above and share the results.
Note that when I rerun the above test with vi -u NONE -U NONE -N spell check works correctly but, of course, there is no syntax highlighting of the markdown file.
Close of added information
vim --clean. Do you have any plugins that might be working with markdown syntax? Generally the way this is affected is by allowing or disallowing spelling in syntax groups. – D. Ben Knoble Jan 19 '21 at 13:10Vim detects that I am editing a markdown file by the file extension I used i.e. either
– sghosh Jan 19 '21 at 19:40.mdor.markdownwuickin all three of the above sentences.Therefore, I thought my vimrc has a problem. So I renamed it and created an empty vimrc file by
– sghosh Jan 20 '21 at 18:55touch .vimrc. Now when I opened the text file with the above three sentences with vim, I saw the same error as I documented above even though my vimrc is empty. So the problem is not with my vimrc.