Saturday, January 26, 2013

How to use fold-marker method with manpage sourcecode?

Hi vimmers,

I'm editing a fairly lengthy manpage, so I'd like to be able to use vim
folding to make the task easier.

I'd like to use fdm=fold-marker, to make my folds persistent, but I
can't figure out how to make this compatible with troff-style comments.

If I select a set of lines and press zf, vim folds the lines and adds
/*{{{*/ and /*}}}*/ to the first and last lines respectively (which were
blank before the fold).

For manpage code, I want that to be .\"{{{ and .\"}}}, since troff
comments are lines beginning with dot backlash doublequote.

Reading vim's online help for foldmarker, I see that I need to set
commentstring. But what syntax should I use to specify the backslash
and quote characters?

I tried set commentstring=.\"
and set commentstring=".\\\""
and set commentstring='.\\\"'
but none of these worked.

There's probably an obvious solution here, but I'm not seeing it.



--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: