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

Re: :set comments

Expand Messages
  • Benji Fisher
    ... This probably has nothing to do with the particular option you are trying to set. If you try ... then it will probably be something other than n:C,n:c .
    Message 1 of 2 , Jan 28, 2001
    • 0 Attachment
      Alexander Wagner wrote:
      >
      > Hi!
      >
      > With :set comments I can tell vim how to format comments.
      > Now I tried this for Fortran-Comments which are marked by a
      > simple C or c at the start of each line (that is in column
      > 1, but this is a detail which vim handles correctly anyway).
      >
      > So I did:
      >
      > :set comments=n:C,n:c
      >
      > and this works perfectly. Now I included this line in my
      > fortran.vim, a macro that is sourced by an autocommand if I
      > fire up a .f-file. But vim doesn't set the comments
      > correctly, instead I've always the default comment string.
      > What did I miss here? Again: if I set the comment "by hand"
      > everything works as expected.
      >
      > (Running vim 6.0t on OS/2 Warp.)

      This probably has nothing to do with the particular option you are
      trying to set. If you try

      :set comments

      then it will probably be something other than "n:C,n:c" . There are a few
      debugging steps you can try:

      1. Look through your macro file, to see whether there is something later
      on that changes the setting of 'comments'.

      2. :set verbose=10 and then load a Fortran file, to see what autocommands
      get executed.

      3. Add a line like ":let g:foo=2001/01/28" to your macro file, near the
      line that sets 'comments'. Use the date, to avoid confusion from
      yesterday's debugging exercise. To see whether this line was executed,
      :echo foo.

      One possibility: since you are using vim 6.0, your file might be
      sourced before a ftplugin, so the ftplugin overrides your settings. Even
      if this is not the problem, why not install this as a ftplugin, instead of
      :source-ing it from an autocommand? :help add-filetype-plugin

      HTH --Benji Fisher
    Your message has been successfully submitted and would be delivered to recipients shortly.