On 16:41 Sat 26 Jan , Charlie Kester wrote:
> 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
>
>
Hi Charlie,
This seems to work
:set cms=.\\\\"%s
Or equivalently you can use this:
:let &cms=".\\\"%s"
or even better:
:let &cms='.\"%s'
In the second example there are three backslashes since \\ inside ""
evaluates to a backslash and the third backslash is used to get ".
While in '' strings you don't need to escape neither backslash nor the
". And you should not forget about the %s, which must be present.
In the first examples there are four backslashes, which after being
provided on the command line evaluate to just two backslashes which then
are treated as in the second example. There is a section in the
documentation: ":help option-backslash", I guess it is mentioned there.
Best,
Marcin
--
--
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
Saturday, January 26, 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment