0

In Vim, without using any markdown plugin, headings like

# Uppercase heading

# lowercase heading

lowercase heading
=================

lowercase heading
-----------------

get highlighted, while headings like

Uppercase heading
=================

Uppercase heading
-----------------

do not get highlighted. (Actually the ---s get highlighted, but not the text above them. However, the ===s stay in the unhighlighted color.)

I want to know why the headings with the ===/----syntax starting with an uppercase character do not get highlighted and what can be done to fix it.

Example screenshot:

enter image description here

8
  • Is filetype detection on? Is the file being identified as markdown? If both of those are true then all of the above should be considered headers. I just verified it.
    – B Layer
    Jun 18, 2021 at 11:25
  • 1
    I use a different theme so it wouldn't look like that but it looks right. More importantly running this with the cursor over the text in question gives the right value :echo synIDattr(synID(line("."), col("."), 1), "name") Example: markdownH2.
    – B Layer
    Jun 18, 2021 at 11:40
  • 1
    Please post a self answer with what fixed it for you (more specifically, the configuration you had in your vimrc that was breaking it) and also which steps led you to find the issue. Thanks!
    – filbranden
    Jun 18, 2021 at 14:46
  • 1
    Agreed with @filbranden; the post can stay if the Q demonstrates the broken configuration and the A addresses how to fix it. Why it breaks would be good too.
    – D. Ben Knoble
    Jun 18, 2021 at 19:05
  • 2
    nijoakim, I've rolled back your edit. Answers belong in answers which are found below. Self-answering/accepting is allowed and even encourage. Please do not edit your question to indicate a solution/answer/etc.
    – D. Ben Knoble
    Jun 19, 2021 at 21:53

1 Answer 1

1

As reported by the OP, this problem does not occur if they delete their vimrc file. The issue arose because of how they had configured the spell checker to highlight capitalized words in beginnings of sentences. This question has thus been resolved.

1
  • Not that I have any particular vested interest, but why didn't this one get closed for the "can't reproduce or user mistake" reason (or as I refer to it, the "oops" category ;)
    – B Layer
    Jun 24, 2021 at 0:16

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.