Hi Gerardo,

You could try to put something like that into your .vimrc:

au BufReadPost *.cpp :syntax region overwrite_cBlock start="\(namespace .*
\)\@<={" end="}"

The overwrite_cBlock region will override the cBlock definition when it is
executed after the commands from c.vim and thus the fold option from the
cBlock will not be triggered. Unfortunatly, all syntax highlighting in this
region will also be concealed. The only way to overcome this, might be to
include the right syntax definitions in the contains section, e.g.:

au BufReadPost *.cpp :syntax region overwrite_cBlock start="\(namespace .*
\)\@<={" end="}" contains=ALLBUT,cBlock

This will however be to much and may have not so nice side effects. Well,
You have to figure out yourself, what to put into the 'contains='
section.

Best regards, Benjamin Schnitzler


On Sun, Jun 30, 2013 at 11:59 PM, Gerardo Marset <[email protected]>wrote:

> I've got foldmethod set to syntax. How can I tell vim not to fold C++
> namespace blocks?
>
> I was able to do it actually, by editing the cBlock sytanx region in the
> default c.vim syntax file like this:
>
> syn region cBlock start="\(namespace .* \)\@<!{" end="}" transparent fold
>
> But it just doesn't look right to do it like that, plus I'd like to have a
> "local" solution (i.e. one I can just put in my .vimrc or somewhere in
> .vim/).
>
> Any ideas?
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to