2

With Commentary I've set the commentstring for markdown:

autocmd FileType markdown setlocal commentstring=<!--\ %s\ -->

When I visually select the lines and gc

a
b
c

I get

<!-- a -->
<!-- b -->
<!-- c -->

where I'd prefer a single block like

<!-- 
a
b
c 
-->

Is this possible with this or another plugin?

laktak
  • 2,933
  • 13
  • 27
  • Commentary explicitly uses single-line comments (easier to parse and handle, every time), so I doubt it can do what you’re after. – D. Ben Knoble Dec 04 '20 at 03:17

1 Answers1

1

Thanks @D. Ben Knoble - I switched to tcomment_vim

Plug 'tomtom/tcomment_vim'
[..]

let g:tcomment#block_fmt_xml = { \ 'commentstring': "<!--%s-->\n", \ 'replacements': g:tcomment#replacements_xml \ } call tcomment#type#Define('markdown', g:tcomment#inline_fmt_xml ) call tcomment#type#Define('markdown_block', g:tcomment#block_fmt_xml )

I've changed the commentstring so I does not prefix any spaces.

laktak
  • 2,933
  • 13
  • 27