Re: :set comments
- Alexander Wagner wrote:
>This probably has nothing to do with the particular option you are
> 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.)
trying to set. If you try
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
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,
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