Sunday, August 16, 2015

Re: C comment block indentation woes

On 15 August 2015, Erik Christiansen <dvalin@internode.on.net> wrote:
> On 14.08.15 04:02, Oliver Wraight wrote:
[...]
> > comments=sO:* -,mO:* ,exO:*/,s1:/*,mb:*,ex:*/,://
> ^^^^^^^^^^^^^^^^
> > Last set from /usr/share/vim/vim74/ftplugin/c.vim
>
> that's what needs to be tweaked.
>
> Unfortunately, performing a :set with that here gives:
>
> E518: Unknown option: -,mO:*
[...]

On a side note: you can usually avoid dealing with ":set" for
options that take string values by using "let &option = ..." instead of
"set option=...". E.g. for the line above:

let &comments = 'sO:* -,mO:* ,exO:*/,s1:/*,mb:*,ex:*/,://'

To set local options you'd use "let &l:option = ..." instead of
"setlocal option=...", and to explicitly set a global options you can do
"let &g:option = ..." instead of "setglobal option=...".

Of course, "&option" can also be used to read the value of an option
if needed.

/lcd

--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: