Loading ...
Sorry, an error occurred while loading the content.

Re: Comment issue with ruby.vim

Expand Messages
  • Antoine J. Mechelynck
    ... I suspect you have filetype-dependent indenting on (the default vimrc, vimrc_example.vim, sets it). Check it with ... If it says indent is ON, that s what
    Message 1 of 4 , Feb 1, 2004
    • 0 Attachment
      Bob Calco <bobcalco@...> wrote:
      > Anybody:
      >
      > I'm fairly new to Vim (on Win32, using Cream), and am having an issue
      > with the syntax behavior for Ruby. I've scoured the ruby.vim file but
      > it isn't jumping out at me what precisely is causing the behavior
      > that's bugging me. Specifically, whenever I try to add a comment,
      > such as to the following:
      >
      > # A comment to describe the foo method
      > def foo
      > end
      >
      > def bar
      > # a comment to describe what is about to happen
      > ...
      > end
      >
      > it pushes the comment to the beginning of the line, where I'm at. So
      > I have to manually re-indent the comment line - it seems to think all
      > comment lines must be at the beginning of every line, and is not
      > respecting the indent level I'm at, even in autoindent mode:
      >
      > # A comment to describe the foo method
      > def foo
      > end
      >
      > def bar
      > # a comment to describe what is about to happen
      > ...
      > end
      >
      > This is terribly annoying, but my mind tells me there's a simple way
      > to fix it. I just don't know what it is.
      >
      > Sincerely,
      >
      > Bob

      I suspect you have filetype-dependent indenting on (the default vimrc,
      vimrc_example.vim, sets it). Check it with

      :filetype

      If it says indent is ON, that's what is causing it.

      I had the same problem when I started using Vim but I found how to
      circumvent it, as follows (here is part of my vimrc):

      --- ~/_vimrc ---
      set nocompatible
      language messages en
      runtime vimrc_example.vim
      filetype indent off
      " etc. (other user-specific settings come here)
      --- ~/_vimrc --- end

      "filetype indent off" is the relevant line in this case, and it comes after
      the vimrc_example has been sourced, in order to override the default
      settings.

      see
      :help 'indentexpr'
      :help :filetype
      :help filetype-overview

      HTH,
      Tony.
    • Gary Johnson
      ... Take a look at ... I haven t read it closely enough to see if that could cause what you re seeing, but it looks promising. HTH, Gary -- Gary Johnson
      Message 2 of 4 , Feb 1, 2004
      • 0 Attachment
        On 2004-02-01, Bob Calco <bobcalco@...> wrote:
        > Anybody:
        >
        > I'm fairly new to Vim (on Win32, using Cream), and am having an issue with
        > the syntax behavior for Ruby. I've scoured the ruby.vim file but it isn't
        > jumping out at me what precisely is causing the behavior that's bugging me.
        > Specifically, whenever I try to add a comment, such as to the following:
        >
        > # A comment to describe the foo method
        > def foo
        > end
        >
        > def bar
        > # a comment to describe what is about to happen
        > ...
        > end
        >
        > it pushes the comment to the beginning of the line, where I'm at. So I have
        > to manually re-indent the comment line - it seems to think all comment lines
        > must be at the beginning of every line, and is not respecting the indent
        > level I'm at, even in autoindent mode:
        >
        > # A comment to describe the foo method
        > def foo
        > end
        >
        > def bar
        > # a comment to describe what is about to happen
        > ...
        > end
        >
        > This is terribly annoying, but my mind tells me there's a simple way to fix
        > it. I just don't know what it is.

        Take a look at

        :help indentkeys-format

        I haven't read it closely enough to see if that could cause what
        you're seeing, but it looks promising.

        HTH,
        Gary

        --
        Gary Johnson | Agilent Technologies
        garyjohn@... | Wireless Division
        | Spokane, Washington, USA
      • Doug Kearns
        ... If you re not using the latest runtime files from http://vim-ruby.rubyforge.org/, try that first. Regards, Doug
        Message 3 of 4 , Feb 2, 2004
        • 0 Attachment
          On Sun, Feb 01, 2004 at 07:15:07PM -0500, Bob Calco wrote:
          > Anybody:
          >
          > I'm fairly new to Vim (on Win32, using Cream), and am having an issue with
          > the syntax behavior for Ruby. I've scoured the ruby.vim file but it isn't
          > jumping out at me what precisely is causing the behavior that's bugging me.

          If you're not using the latest runtime files from
          http://vim-ruby.rubyforge.org/, try that first.

          <snip>

          Regards,
          Doug
        Your message has been successfully submitted and would be delivered to recipients shortly.