cinoptions : templates

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

cinoptions : templates

Aaron Griffin
Ok well, here's my issue... my current cinoptions looks like this:
set cinoptions=g0,:0,l1,(0,t0

now, this is almost exactly what I'm looking for, except, when I
declare c++ templates on seperate lines, it indents wrongly...

>>>>>>
template <typename T>
    class Foo
    {
        int bar;
    };
<<<<<<
should be
>>>>>>
template <typename T>
class Foo
{
    int bar;
};
<<<<<<

I can't seem to find anyway to force the indentation to follow.... any ideas?
Reply | Threaded
Open this post in threaded view
|

Re: cinoptions : templates

Aaron Griffin
On 7/25/05, Aaron Griffin <[hidden email]> wrote:

> Ok well, here's my issue... my current cinoptions looks like this:
> set cinoptions=g0,:0,l1,(0,t0
>
> now, this is almost exactly what I'm looking for, except, when I
> declare c++ templates on seperate lines, it indents wrongly...
>
> >>>>>>
> template <typename T>
>     class Foo
>     {
>         int bar;
>     };
> <<<<<<
> should be
> >>>>>>
> template <typename T>
> class Foo
> {
>     int bar;
> };
> <<<<<<
>
> I can't seem to find anyway to force the indentation to follow.... any ideas?

I'm going to bump this once just in case - I can't be the only one who
doesn't like the default  indenting, can I?

If no one responds this time, I'll consider this dead in the water.
Reply | Threaded
Open this post in threaded view
|

Re: cinoptions : templates

t. scott urban
On Tue, 2005-07-26 at 11:57 -0500, Aaron Griffin wrote:

> On 7/25/05, Aaron Griffin <[hidden email]> wrote:
> > Ok well, here's my issue... my current cinoptions looks like this:
> > set cinoptions=g0,:0,l1,(0,t0
> >
> > now, this is almost exactly what I'm looking for, except, when I
> > declare c++ templates on seperate lines, it indents wrongly...
> >
> > >>>>>>
> > template <typename T>
> >     class Foo
> >     {
> >         int bar;
> >     };
> > <<<<<<
> > should be
> > >>>>>>
> > template <typename T>
> > class Foo
> > {
> >     int bar;
> > };
> > <<<<<<
> >
> > I can't seem to find anyway to force the indentation to follow.... any ideas?
>
> I'm going to bump this once just in case - I can't be the only one who
> doesn't like the default  indenting, can I?
>
> If no one responds this time, I'll consider this dead in the water.


I don't much care for it either.  Sometimes it seems to work correctly,
sometimes not.


--
t. scott urban <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: cinoptions : templates

t. scott urban
On Tue, 2005-07-26 at 10:24 -0700, t. scott urban wrote:

> On Tue, 2005-07-26 at 11:57 -0500, Aaron Griffin wrote:
> > On 7/25/05, Aaron Griffin <[hidden email]> wrote:
> > > Ok well, here's my issue... my current cinoptions looks like this:
> > > set cinoptions=g0,:0,l1,(0,t0
> > >
> > > now, this is almost exactly what I'm looking for, except, when I
> > > declare c++ templates on seperate lines, it indents wrongly...
> > >
> > > >>>>>>
> > > template <typename T>
> > >     class Foo
> > >     {
> > >         int bar;
> > >     };
> > > <<<<<<
> > > should be
> > > >>>>>>
> > > template <typename T>
> > > class Foo
> > > {
> > >     int bar;
> > > };
> > > <<<<<<
> > >
> > > I can't seem to find anyway to force the indentation to follow.... any ideas?
> >
> > I'm going to bump this once just in case - I can't be the only one who
> > doesn't like the default  indenting, can I?
> >
> > If no one responds this time, I'll consider this dead in the water.
>
>
> I don't much care for it either.  Sometimes it seems to work correctly,
> sometimes not.


A little more data.  My cinoptions:

    >s,e0,n0,f0,{0,}0,^0,:s,=s,ps,t0,+s,(s,)100,*200,g0  

The top level template definition indents correctly, the template member
function declaration indents incorrectly, e.g.:

template<class Foo, class Bar>
struct baz
{
        template<int I>
                void f ();
};


--
t. scott urban <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: cinoptions : templates

John (Eljay) Love-Jensen
The cinoptions that is throwing things off is + and maybe g.

Try:

:set cino=g0,+0

Otherwise, things get thrown off in this situation:

namespace foo
{

    struct bar
    {
    public:
        bar();  

        template<typename T>
        func();
    };

}

Now if I could only make the namespace body braces non-indenting...

HTH,
--Eljay


Reply | Threaded
Open this post in threaded view
|

Re: cinoptions : templates

Aaron Griffin
Well, that last email was supposed to be to the whole list... but it wasn't 8)

Anyway, for namespace brackets, ^-s may work - ^N adds N to the indent
if the opening bracket is on column 0, s is for shiftwidth, so with
"^-s", if the opening bracket is on column 0, then the next indent
level is indented by nothing at all.
namespace foo
{
struct bar
{
   void foo();
};
}

still missing the template indent though... ugh

On 7/26/05, Eljay Love-Jensen <[hidden email]> wrote:

> The cinoptions that is throwing things off is + and maybe g.
>
> Try:
>
> :set cino=g0,+0
>
> Otherwise, things get thrown off in this situation:
>
> namespace foo
> {
>
>     struct bar
>     {
>     public:
>         bar();
>
>         template<typename T>
>         func();
>     };
>
> }
>
> Now if I could only make the namespace body braces non-indenting...
>
> HTH,
> --Eljay
>
>
>