9

I'm experiecing the most annoying thing ever: when I edit a markdown file, asterisk characters are hidden by default.

If I set on an open buffer :set conceallevel=0, asterisks shows up as they should, but if I put this conf in my init.vim file, it does not work anymore.

How to solve that? And more important, is there a way to know which plugin override my configuration?

Thank you.

10
  • That's an expected behavior, it should make you text bold. Could it be that your terminal or colorscheme are not playing well and it is annoying that the asterisks just disappear? By the way, anychance you have the Vimwiki plugin configured to use markdown? You might find this useful: github.com/mhinz/vim-galore#debugging-1
    – lsrdg
    May 29 '17 at 8:55
  • No issues with the terminal. I open the file: no asterisks and bold text between pairs of invisible asterisks. Then I set conceallevel=0 on the open buffer: asterisks appear and no more bold text. The latter is the default I want, but if I put it in my init.vim it does not work. With nvim -u NONE -N it works like expected: I can see asterisks.
    – caneta
    May 29 '17 at 9:00
  • What about: augroup filetype_markdown autocmd! autocmd FileType md setlocal conceallevel=0 augroup END
    – lsrdg
    May 29 '17 at 9:05
  • It does not work: asterisk are still hidden...
    – caneta
    May 29 '17 at 9:10
  • Have you put the augroup on your init.vim and resourced or reopened neovim?
    – lsrdg
    May 29 '17 at 9:12
21

To help answer your original question, you can check where a setting was last set with the :verbose command.

:verbose set conceallevel

This will display a message similar to:

conceallevel=2
    Last set from ~/.vim/plugged/indentLine/after/plugin/indentLine.vim

Note that :verbose simply runs a command with a specified verbosity, so if you wish to check something like the number setting, you'll need to run :verbose set number? (with the ?, otherwise it will just turn the setting on). Check :h :verbose for more.

0
9

Ok, I found the plugin involved into this: is indentLine. It is reported in its README: it does not work if conceallevel is not set to 1 or 2, so it set this parameter to 2 by default.

The side effect is that markdown files are terribly displayed, and you cannot edit them confortably...

I found it out debugging my init.vim thanks to lsrdg link suggestion.


Update: I solved my problem avoiding IndentLine to start for Markdown files, putting the following in my init.vim:

autocmd FileType markdown let g:indentLine_enabled=0
6

Like @caneta, the indentLine plugin was the culprit for me too. I solved it by disabling it for markdown files like this:

let g:indentLine_fileTypeExclude = ['markdown']
1

vimwiki also sets conceallevel as well:

*g:vimwiki_conceallevel*

In Vim 7.3 'conceallevel' is local to the current window, thus if you open a
Vimwiki buffer in a new tab or window, it would be set to the default value.

Vimwiki sets 'conceallevel' to g:vimwiki_conceallevel every time a Vimwiki
buffer is entered.

With default settings, Vimwiki conceals one-character markers, shortens long
URLs and hides markers and URL for links that have a description.

Default: 2

------------------------------------------------------------------------------
*g:vimwiki_conceal_onechar_markers*

Control the concealment of one-character markers.

Setting 'conceal_onechar_markers' to 0 will show the markers, overriding
whatever value is set in |g:vimwiki_conceallevel|

Default: 1

------------------------------------------------------------------------------

If you don't want Vimwiki to conceal markers, add the following line to your .vimrc:

let g:vimwiki_conceallevel=0

0

Or create a Toggle mapping:

nnoremap <Leader>c :let &cole=(&cole == 2) ? 0 : 2 <bar> echo 'conceallevel ' . &cole <CR>

I am using the abbreviated form of conceallevel cole to make my line shorter

We can also test if the plugin indentline is loaded and then...

if match(&runtimepath, 'indentline') != -1
    let g:indentLine_fileTypeExclude = ['markdown']
endif

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.