Comments and indenting

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Comments and indenting

Gavin Sinclair
[Forwarded message from Brian Doyle.  Just wondering if anyone has a solution.]

I'm new to vim and ruby so I'm not actually sure where the problem.
First off thanks for writing the ruby.vim code!  I've been using it
quite a bit and it's been great.  I do have one issue that doesn't
seem to be quite right.  When I start a comment above a method the #
always moves over all the way to the right.

class Blah

   # <start comments>
   def do_something

   end
end

Immediately after entering the # it moves to:

class Blah

#
   def do_something

   end
end

Not sure if this is a problem with ruby.vim or what exactly.  i
noticed that this only happens after doing a C-O or C-o and then type
the #.   Thanks for your help.
_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Comments and indenting

Nikolai Weibull-11
On 8/30/07, Gavin Sinclair <[hidden email]> wrote:

> [Forwarded message from Brian Doyle.  Just wondering if anyone has a solution.]
>
> I'm new to vim and ruby so I'm not actually sure where the problem.
> First off thanks for writing the ruby.vim code!  I've been using it
> quite a bit and it's been great.  I do have one issue that doesn't
> seem to be quite right.  When I start a comment above a method the #
> always moves over all the way to the right.
>
> class Blah
>
>    # <start comments>
>    def do_something
>
>    end
> end
>
> Immediately after entering the # it moves to:

[the beginning of the line]

:h 'indentkeys'

You seem to have messed up your setup.  Make sure your 'indentkeys'
setting is set to

  0{,0},0),0],!^F,o,O,e

> Not sure if this is a problem with ruby.vim or what exactly.  i
> noticed that this only happens after doing a C-O or C-o and then type
> the #.   Thanks for your help.

C-O/C-o?

  nikolai
_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Comments and indenting

Tim Pope-2
In reply to this post by Gavin Sinclair
> Immediately after entering the # it moves to:
>
> class Blah
>
> #
>    def do_something
>
>    end
> end

Sounds like 'smartindent' to me.  The ruby ftplugin doesn't set it;
the user vimrc is the most likely culprit.

Cheers,
Tim
_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Comments and indenting

Nikolai Weibull-11
On 8/30/07, Tim Pope <[hidden email]> wrote:

> > Immediately after entering the # it moves to:
> >
> > class Blah
> >
> > #
> >    def do_something
> >
> >    end
> > end
>
> Sounds like 'smartindent' to me.  The ruby ftplugin doesn't set it;
> the user vimrc is the most likely culprit.

Actually, the latest version should be unsetting 'smartindent' (which
should be done by the filetype-handling code in my opinion, but Bram
didn't agree with me).  Strange.  Perhaps he's using an old version.
Bug reports against old versions are always grade A.

  nikolai
_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Loading...