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

Re: how to avoid comments always beginning at a line

Expand Messages
  • Ciaran McCreesh
    ... -- Ciaran McCreesh : Gentoo Developer (Vim, Fluxbox, shell tools) Mail : ciaranm at gentoo.org Web : http://dev.gentoo.org/~ciaranm
    Message 1 of 2 , Dec 29, 2004
      On Wed, 29 Dec 2004 18:20:58 -0800 Osho GG <oshogg@...> wrote:
      | I have a question about editing Tcl/shell scripts etc. programming
      | languages' source code in Vim. Whenever I press enter or open a new
      | line the cursor is positioned at the right indent position. This is,
      | of course, very good. If I start typing code - it works fine. However
      | if I press # (which is a comment), the cursor moves the the very
      | beginning of the line (column 1) and the # is the very first character
      | of the line. This is very annoying. Sometimes, I do not want the
      | comments at the beginning of the line (for example inside an if or a
      | for loop). If I press space, delete and then #, # is at the right
      | place.
      |
      | This is driving me nuts :(. Any helpful suggestion would be greatly
      | appreciated.

      :help smartindent

      > When typing '#' as the first character in a new line, the indent for
      > that line is removed, the '#' is put in the first column. The indent
      > is restored for the next line. If you don't want this, use this
      > mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.

      --
      Ciaran McCreesh : Gentoo Developer (Vim, Fluxbox, shell tools)
      Mail : ciaranm at gentoo.org
      Web : http://dev.gentoo.org/~ciaranm
    Your message has been successfully submitted and would be delivered to recipients shortly.