How do I keep concealed text hidden even on the cursor line so Markdown or LaTeX stays formatted while I navigate?
Answer
:set concealcursor=nvi
Explanation
When 'conceallevel' is 2 or higher, Vim hides syntax markers—turning raw Markdown like **bold** into visual bold or collapsing LaTeX commands. By default, the concealed text on the cursor line is revealed so you can see what you are editing. Setting 'concealcursor' tells Vim which modes should keep the text concealed even on the cursor line, giving a true "reading mode" experience.
How it works
'concealcursor'accepts a string of mode characters:n(normal),v(visual),i(insert),c(command-line):set concealcursor=nvi— keep concealment on the cursor line in normal, visual, and insert modes:set concealcursor=(empty, the default) — always reveal concealed text on the cursor line
Combine with conceallevel=2 for full effect:
set conceallevel=2
set concealcursor=nvi
Example
In a Markdown buffer with a plugin that conceal syntax, the raw text **bold** normally re-appears when your cursor lands on that line. With concealcursor=nvi, it stays visually formatted even under the cursor.
Tips
- Omit
ifromconcealcursorif you want the raw syntax revealed while typing, which makes editing individual characters easier concealcursor=ncis a popular compromise: stay concealed in normal and command modes but reveal in insert and visual- Works with any plugin that uses Vim's
concealsyntax attribute, includingvimtex,vim-markdown, andplasticboy/vim-markdown