Hi Caolán,

On Monday, 2016-05-09 09:54:42 +0100, Caolán McNamara wrote:

> [... switch case indent ...]

Parts of that seem to be what the default Vim C-indent options cause, i.e.

switch (foo)
{
    case bar:
        ...
        break;
    case bar:
        {
            ...
        }
        break;
}

Modifying the cinoptions settings helps, in particular if the bN option
is not used (or N=0) (which I was guilty of for example, now changed ;-)
then the break statement is indented as well, b1 cures this to

switch (foo)
{
    case bar:
        ...
    break;
    case bar:
        {
            ...
        }
    break;
}

However, this only when re-indenting the code, to automatically do this
when typing also add 0=break to cinkeys.

Additional helpful settings are N-s to not indent inside a namespace
block, and g0 to not indent private: and public: within a class
declaration.

So, to combine, the settings would be

set cinoptions=b1,g0,N-s
set cinkeys+=0=break

We could force that in the mode lines.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key "ID" 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Better use 64-bit 0x6A6CD5B765632D3A here is why: https://evil32.com/
Care about Free Software, support the FSFE https://fsfe.org/support/?erack

Attachment: signature.asc
Description: PGP signature

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to