Ok, the problem is in your .vimrc:
" this only works if the "filetype plugin indent on" command precedes the
" "syntax on" command
let s:extfname = expand("%:e")
if s:extfname ==? "f90"
let fortran_free_source=1
unlet! fortran_fixed_source
else
let fortran_fixed_source=1
unlet! fortran_free_source
endif
If you don't start Vim with a .f90 file, then 'fortran_fixed_source' is set to
'1' and all .f90 files will try to highlight as fixed source (looking for
numbers). You should put the block of code into your ftplugin/fortran.vim and
make it to use the buffer-local variables instead:
~/.vim/ftplugin/fortran.vim
" Don't do other file type settings for this buffer
let b:did_ftplugin = 1
+ " use free source format for all .f90 files:
+ let s:extfname = expand("%:e")
+ if s:extfname ==? "f90"
+ let b:fortran_fixed_source = 0
+ else
+ let b:fortran_fixed_source = 1
+ endif
regards,
Peter
--- Kamaraju Kusumanchi <[EMAIL PROTECTED]> wrote:
> On Wednesday 11 October 2006 19:31, Peter Hodge wrote:
>
> > At any rate, using ':setfiletype fortran' should fix the problem straight
> > away.
>
> No. This does not change the behavior. I cannot get the correct syntax
> highlighting even after doing this.
>
> > The distributed ftplugin file for fortran sets a variable called
> > 'b:fortran_fixed_source' to let the syntax file know how to highlight. The
> > 'bad highlighting' is because the ftplugin file isn't being executed (for
> > some reason?) and so the syntax defaults to using wrong highlighting (it's
> > looking for numbers at the start of each line).
>
> This could be the reason. I have changed the default
> .vim/ftplugin/fortran.vim
> quite a bit and might have messed it up somewhere.
>
> > Curiously, my Vim doesn't
> > have a problem with opening a session and choosing the correct
> > highlighting, so I wonder if something in your custom ftplugin or syntax
> > files is preventing the distributed ftplugin file from detecting the
> > fortran format correctly? Is there any chance you could paste the contents
> > of your .vim/ftplugin/fortran.vim into an email?
>
> I think this list does not allow any attachements (my messages were not
> delivered when I attached the files). So I posted
> my .vimrc, .gvimrc, .vim/ftplugin/fortran.vim, .vim/indent/fortran.vim at
> http://kamaraju.googlepages.com/vim_problems .
>
> Please forgive me for not "tidying up" those configuration files. But I hope
> you guys wont have any trouble digging through them.
>
> Thanks for all the replies so far.
>
> raju
>
> --
> http://groups.google.com/group/ask-anything/about
>
____________________________________________________
On Yahoo!7
Photos: Unlimited free storage keep all your photos in one place!
http://au.photos.yahoo.com