1

I am quite new to Neovim, just installed some of the important plugins and now I wanted to make it really good for writing Markdown files. I installed vim-markdown for that, and followed the documentation in the Git repo.

Even-though I followed the explanations, I wasn't able to make the concealing work. I am doing a lua configuration. I installed the plugin using packer and created a vim-markdown.lua file in a .config/nvim/after directory, where I put my plugin's configuration and keymaps.

I just wrote in there what the README in the GIT repo says. The vim-markdown.lua looks like this:

vim.g.vim_markdown_folding_level = 1 

vim.g.vim_markdown_toc_autofit = 1

vim.o.conceallevel=2 

vim.g.vim_markdown_conceal = 1

While installing some other plugin, I came up with this information: Requisites for concealing

To clarify:

  • The markdown plugin is the preservim/vim-markdown
  • The font on my terminal is the Monospace
  • The colorscheme I have in neovim is the tokyonight, dark version.
  • I am using Terminator as my terminal

Shouldn't this work? Once I open a Markdown file, there is no conceal to be seen...

I appreciate all the feedback. Thank you!

1
  • Do you still have the problem? What if you set the settings using the Neovim commands: ? (i.e.: let g:vim_markdown_folding_level=1) Sep 12, 2023 at 5:18

1 Answer 1

0

I don't think Neovim loads lua file from nvim\after.

If you want your setting to apply specifically to the markdown file type I would create a markdown.vim file within: ~/.config/nvim/after/ftplugin with the following content:

let g:vim_markdown_folding_level=1 

let g:vim_markdown_toc_autofit=1

set conceallevel=2 

let g:vim_markdown_conceal=1

Remark: It seems that this version of vim-markdown has more attention than the Tim Pope's version

Remark: For markdown writing a popular choice seems to be vimwiki

6
  • I am not sure that is the problem. All my plugin configs are written in that format. And yes, even though the image references other markdown plugin, I am using the one you mentioned now. But I liked the idea of putting the configuration inside the ftplugin folder
    – Educpf
    Sep 12, 2023 at 13:19
  • It is a good idea to use the ftplugin folder. It is exactly the purpose but I strongly doubt that lua file are loaded from there. I advice you to verify the buffer setting by running the corresponding Neovim commands (e.g.: :set conceallevel?) Sep 12, 2023 at 14:10
  • Yhea, its a really good idea. Btw, is there a way to make it so some of the configs, like keybindings only work in .md buffers? It does load, the output is conceallevel=2. In the beginning I doubted as well, but with a simple print statement I found that in the startup all the those files are loaded.
    – Educpf
    Sep 12, 2023 at 14:19
  • 1
    I appreciate the help!
    – Educpf
    Sep 12, 2023 at 14:44
  • 1
    The problem is that the big question is still unanswered ahah.
    – Educpf
    Sep 12, 2023 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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