tpope / vim-markdown

Vim Markdown runtime files
1.22k stars 191 forks source link

Set dummy indentexpr to prevent C-indenting #187

Closed tomtomjhj closed 2 years ago

tomtomjhj commented 2 years ago

vim-surround runs = after inserting parentheses. If equalprg and indentexpr are empty, = does C-indenting, which usually messes up formatting of markdown documents. Setting indentexpr to -1 makes = no-op.

I sneaked this change into ftplugin/ instead of indent/ because I believe it doesn't do anything special or intrusive that deserves a new file.

tpope commented 2 years ago

I'm solving this by disabling Surround indenting if no Vim indenting option is set. There's no precedent for setting an indenting option inside a ftplugin.

If there are other reasons to set indentexpr=-1, then we should probably suck it up and create a proper indent plugin.