简体   繁体   中英

Vim syntax off for markdown in .vimrc

At the moment I use :syntax off for markdown. But I'd like to make it syntax off when I edit a markdown file.

I tried this in .vimrc but md files has syntax.

"""""syntax off for markdown"""
if &ft=='md'
    syntax off
else
    syntax on
endif

How can I do it?

You can accomplish it with an auto-command for all buffers for which the filetype is set to "markdown", or "md", like so:

autocmd Filetype markdown setlocal syntax=OFF

You can read about the syntax of commands Vim can execute automatically with :help :autocmd .

I got the answer from here .

Create ~/.vim/after/syntax/markdown.vim with:

setlocal syntax=

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM