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

Re: fortran highlighting not working

Expand Messages
  • Srinath
    I had to create ~/.vim/ftplugin directories. I added f90.vim and also added a F90.vim with the solo line: let fortran_free_source=1 This did not work. I must
    Message 1 of 7 , Sep 2, 2008
    • 0 Attachment
      I had to create ~/.vim/ftplugin directories. I added f90.vim
      and also added a F90.vim with the solo line:

      let fortran_free_source=1

      This did not work. I must be missing some.
      <>Srinath

      On Sep 2, 1:40 pm, Nico Weber <nicolaswe...@...> wrote:
      > Hi Srinath,
      >
      > On 02.09.2008, at 20:04, Srinath wrote:
      >
      > > Is it the case that the .gvimrc is sourced only once upon starting
      > > MacVim?
      >
      > Yes. That's normal vim behavior.
      >
      > > So, how do get the .vimrc or .gvimrc source with every new tab?
      >
      > You do not really want to do that :-) What you want is a file plugin.  
      > `:h vimrc-filetype` gives an overview what this is, but a not very  
      > good one. Here's what you want to do, in a nutshell:
      >
      > 1. Put `filetype plugin on` in your .vimrc
      >
      > 2. Add a file called `f90.vim` to the folder ~/.vim/ftplugin/. This  
      > file will be execute every time you edit a .f90 file
      >
      > 3. Put `let fortran_free_source=1` in that file.
      >
      > Now everything should work fine. If not, get back to us.
      >
      > >  Also, can I get an explanation for the different purposes for .vimrc
      > > and .gvimrc?
      >
      > Sure. .vimrc is read ever time you start MacVim. .gvimrc is only read  
      > when starting in gui mode (type `vim` in a terminal and hit enter to  
      > see vim in non-gui mode).
      >
      >
      >
      > HTH,
      > Nico
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Nico Weber
      Hi, ... my fault, I m just not familiar with that fortran stuff :-P So, remove f90.vim and F90.vim and instead put a file called fortran.vim into
      Message 2 of 7 , Sep 3, 2008
      • 0 Attachment
        Hi,

        On 03.09.2008, at 06:35, Srinath wrote:

        > I had to create ~/.vim/ftplugin directories. I added f90.vim
        > and also added a F90.vim with the solo line:
        >
        > let fortran_free_source=1
        >
        > This did not work. I must be missing some.

        my fault, I'm just not familiar with that fortran stuff :-P So, remove
        f90.vim and F90.vim and instead put a file called 'fortran.vim' into
        ~/.vim/ftplugin (the file needs to be called like the filetype it
        should be loaded for -- the output of `:set filetype?` is hopefully
        "fortran" on your system, too). In that file fortran.vim put

        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

        Note that this will work only if the "filetype plugin indent on" command
        precedes the "syntax on" command in your .vimrc file.

        (taken from `:h fortran`).

        Does this help?

        Nico

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      Your message has been successfully submitted and would be delivered to recipients shortly.