Home  >  Q&A  >  body text

vimscript - How to eliminate once and for all the side effects of folding, expanding and syntax highlighting caused by vim-markdown on octopress markdown files?

vim-markdown This plug-in will automatically set foldmethod=expr for files with filetype being mkd, which will use rake new_post The generated markdown file has the side effect of folding somewhere, expanding and syntax highlighting:

How to eliminate it once and for all without changing foldmethod? Thanks!

Updated: I expected that there would be no good solution, but I found a new plug-in vim-octopress that can replace vim-markdown. Not only does it not have the side effects of the former, but it also supports rakeCommand built-in. There is no need to dwell on this issue any longer.

ringa_leeringa_lee2736 days ago756

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-05-16 16:43:55

    Look at the help documentation of vim-markdown. You should be able to disable vim-markdown by setting variables in .vimrc. You can even remove this plugin if you don't use it.

    ps. vim itself also comes with a markdown plug-in, but it is limited to syntax highlighting.

    Another method, for reference only: After opening the markdown file, :set ft=txt. Or add a vim modeline:

    at the beginning or end of the markdown file that you don’t want to collapse and highlight.
    <!-- vim: set ft=txt: -->
    

    Not sure if it will work, give it a try. I haven't used vim for a long time.

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 16:43:55

    You can try adding this line to .vimrc to disable markdown’s folding function:

    autocmd BufNewFile,BufRead *.md set nofoldenable
    

    reply
    0
  • Cancelreply