vim-markdown
vim-markdown copied to clipboard
fenced code block indentation indent autoindent
I have this code in a markdown file, syntax.md (from the tests) but when I attempt to autoindent it (gg=G) it seems to remove the indenting from the ruby code block. Is auto indentation possible in a fenced code block?
Im on vim 8.1 (including patches 1-606)
def f
0
end
After I use the
def f
0
end
set indentexpr? returns indentexpr=GetMarkdownIndent()
I would like to keep it indented. Also, all of the tests seem to pass fine, which leads me to believe it may not be capable. If this isnt a possibility what do you do for auto indented fenced code blocks in markdown?
Same problem here on neovim. Is there any solution yet?
Add the following code to /path/to/plugin/indent/markdown.vim around line 60 in GetMarkdownIndent() function.
It should do the trick (not messing with the indentation of the fenced code)
let hg = join(map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")'))
if hg =~ 'mkdSnippet*'
return -1
endif