On 2012-03-05, danabble wrote:
> I want to make some changes to the fortran.vim syntax coloring scheme.
> 
> It seems reasonable to assume that there is some way to ask vim to
> look into a directory in my home for fortran.vim before looking in
> $VINRUNTIME/syntax/fortran.vim.

There is.  Vim searches runtime directories in the order given in
'runtimepath'.  By default, it will search your ~/.vim/syntax before
$VIMRUNTIME/syntax, and it will search your ~/.vim/after/syntax
last.  See

    :help 'runtimepath'

> The changes I want to make are:
>   * start the past-column-72 reverse-highlight warning at column 138.
>   * do the past-column-highlight on other highlight words.
>     (right now, a highlit word or number hanging over the boundary is
> NOT reverse-lit,
>     ultimately resulting in an avoidable compiler error.)
> 
> I have located the system fortran.vim file, and I know how to make the
> changes above, but making changes to system files is not a good idea
> (even if I had privilege).
> 
> I already have a ~/.vim/ftplugin/fortran.vim file which contains
> 
> let s:extfname = expand("%:e")    " get the current file's extension.
> if s:extfname ==? "f"             " if extension is .f
>   let fortran_fixed_source=1      " then assume fixed form source
>   unlet! fortran_free_source      " and never use free source.
>   let fortran_do_enddo=1          " also, indent do loops.
> endif
> 
> Any help is appreciated!

If you want to _replace_ the system file with your own, simply copy
$VIMRUNTIME/syntax/fortran.vim to ~/.vim/syntax/fortran.vim and make
your changes in the latter.  There are two bits of code in that
file,

    if exists("b:current_syntax")
      finish
    endif

and

    let b:current_syntax = "fortran"

that prevent it from being loaded twice for the same buffer and that
prevent it from being loaded at all if your
~/.vim/syntax/fortran.vim contains the same code.

See

    :help 44.11
    :help 44.12

Regards,
Gary

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to