I'd like to edit text with markdown syntax. Searching for ways of using mixed syntax in the same file I've discovered this question with an answer saying that if I add the line let g:markdown_fenced_languages = ['c'] on my vimrc file it'd accept the c language syntax. Alternativey, there's also this question with an answer that recommends installing the vim-pandoc and vim-pandoc-syntax plugins.
In my case, none of those solutions are working... I've tried adding the line let g:markdown_fenced_languages = ['c'] on my vimrc file and opening a markdown file with a small piece of c code and the syntax was not working. Also, I use VimPlug for installing plugins, so I removed all other plugins that I had installed and added the following on my vimrc file:
call plug#begin('~/.vim/plugged')
Plug 'vim-pandoc/vim-pandoc'
Plug 'vim-pandoc/vim-pandoc-syntax'
call plug#end()
Together with installing them with :PlugInstall on a file. But that didn't work for me at all as well. Am I missing something? In my view the markdown syntax would be working as soon as I had the vim-pandoc and vim-pandoc-syntax installed... Just like it's with other plugins related to syntax on Vim.
.mdshould also work as an extension as well. If you only need the syntax, you can:setlocal syntax=markdown, but typically you want the filetype. – D. Ben Knoble May 02 '21 at 20:25.tid... In this specific case, adding the lineautocmd BufEnter *.tid :setlocal filetype=markdownin my vimrc file completely solved the problem because it'll automatically see all my.tidfiles as.markdownfiles. – raylight May 02 '21 at 20:31BufReadis slightly better thanBufEnter(becauseBufReadwill only fire once, when the buffer is first opened, whileBufEnterevery time you enter that buffer), but yeah associating the extension with the type is the way to go. – filbranden May 02 '21 at 21:14