comment indentation

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

comment indentation

Will Rogers-2
Hi,

I use your vim-ruby scripts to make writing Rails code a little more
pleasant.  One thing drives me batty, though, and I want to find out
if it's some sort of glitch or a genuine bug in the ruby indentation
file.

Simply put, whenever I go to start a line with a comment, the line
jumps all the way to the left as soon as I type the '#'.  If I then
exit insert mode and do a == or other command that re-indents the line
in question, it returns to its proper indentation level.  What's going
on here?  It's terribly annoying.

Thanks for your time,

--
Will Rogers
[hidden email]

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

Re: comment indentation

Nikolai Weibull-11
On 4/21/06, Will Rogers <[hidden email]> wrote:
> Simply put, whenever I go to start a line with a comment, the line
> jumps all the way to the left as soon as I type the '#'.  If I then
> exit insert mode and do a == or other command that re-indents the line
> in question, it returns to its proper indentation level.  What's going
> on here?  It's terribly annoying.

It sounds like you don't have the right indentation file installed.
In our indent/ruby.vim we set the 'indentkeys' option to a value that
suits Ruby.  It does not include '#' as it only makes sense for C and
a few other languages.  However, it is in the 'indentkeys' option by
default, so it seems that your setup isn't quite right.

Please read the installation documentation.  If you're still unable to
get this to work correctly, I'm going to leave this to Doug and/or
Gavin.

  nikolai (who, without resentment, wonders how hard it can actually be)

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

Re: comment indentation

Will Rogers-2
On 4/21/06, Nikolai Weibull <[hidden email]> wrote:
> On 4/21/06, Will Rogers <[hidden email]> wrote:
> > Simply put, whenever I go to start a line with a comment, the line
> > jumps all the way to the left as soon as I type the '#'.
>
> It sounds like you don't have the right indentation file installed.

I did have the right files installed, and I did read the documentation
:P  Thanks to your feedback though, I knew to look to my configuration
for the problem.  Some experimentation traced it to smartindent.  Got
rid of that and everything is grand.

Thanks for the help.

--
Will Rogers
[hidden email]

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

Re: comment indentation

Nikolai Weibull-11
On 4/21/06, Will Rogers <[hidden email]> wrote:

> On 4/21/06, Nikolai Weibull <[hidden email]> wrote:
> > On 4/21/06, Will Rogers <[hidden email]> wrote:
> > > Simply put, whenever I go to start a line with a comment, the line
> > > jumps all the way to the left as soon as I type the '#'.
> >
> > It sounds like you don't have the right indentation file installed.
>
> I did have the right files installed, and I did read the documentation
> :P  Thanks to your feedback though, I knew to look to my configuration
> for the problem.  Some experimentation traced it to smartindent.  Got
> rid of that and everything is grand.

Ah!

We used to disable 'smartindent' in indent/ruby.vim, but that's really
not the place to do so so it was removed.  The thing about
'smartindent' is that it should only be set in an indent script
explicitly, not in a users vimrc or similar.  'Smartindent' stems from
a time before indent scripts and is quite useless under most
circumstances today.

Perhaps we should add a comment about 'smartindent' in some sort of
FAQ or perhaps to the installation documentation.

Will: thanks for giving us an explanation as to what the cause was.

  nikolai

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

Re: comment indentation

Gavin Sinclair
On 4/22/06, Nikolai Weibull <[hidden email]> wrote:

> We used to disable 'smartindent' in indent/ruby.vim, but that's really
> not the place to do so so it was removed.  The thing about
> 'smartindent' is that it should only be set in an indent script
> explicitly, not in a users vimrc or similar.  'Smartindent' stems from
> a time before indent scripts and is quite useless under most
> circumstances today.

Should indent/ruby.vim *disable* smartindent?

> Perhaps we should add a comment about 'smartindent' in some sort of
> FAQ or perhaps to the installation documentation.

The FAQ/doc could say that smartindent is disabled in indent/ruby.vim
and the user should use their .vimrc or whatever to reenable it if
they really want to.

> Will: thanks for giving us an explanation as to what the cause was.

+1

Gavin

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

Re: comment indentation

Nikolai Weibull-11
On 4/22/06, Gavin Sinclair <[hidden email]> wrote:

> On 4/22/06, Nikolai Weibull <[hidden email]> wrote:
>
> > We used to disable 'smartindent' in indent/ruby.vim, but that's really
> > not the place to do so so it was removed.  The thing about
> > 'smartindent' is that it should only be set in an indent script
> > explicitly, not in a users vimrc or similar.  'Smartindent' stems from
> > a time before indent scripts and is quite useless under most
> > circumstances today.
>
> Should indent/ruby.vim *disable* smartindent?

Yeah, I've discussed this with Bram and he thought it best.  So could
you please add a nosmartindent to it?

Thanks.

  nikolai

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

Re: comment indentation

Doug Kearns
On Mon, Apr 24, 2006 at 09:33:38PM +0200, Nikolai Weibull wrote:

> On 4/22/06, Gavin Sinclair <[hidden email]> wrote:
> > On 4/22/06, Nikolai Weibull <[hidden email]> wrote:
> >
> > > We used to disable 'smartindent' in indent/ruby.vim, but that's really
> > > not the place to do so so it was removed.  The thing about
> > > 'smartindent' is that it should only be set in an indent script
> > > explicitly, not in a users vimrc or similar.  'Smartindent' stems from
> > > a time before indent scripts and is quite useless under most
> > > circumstances today.
> >
> > Should indent/ruby.vim *disable* smartindent?
>
> Yeah, I've discussed this with Bram and he thought it best.  So could
> you please add a nosmartindent to it?
>
> Thanks.

Done.

Regards,
Doug
_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel