4

I am using vim to edit a fortran 90 file. The length of a code line exceeds the 73-character column limit:

  print*, &
  "Not sufficiently large neighbours list in dynstillweb, increase max_n"

The problem is that vim not only marks as red the exceeding characters (say, se max_n"), but also the rest of the code instead of the usual white, yellow, and blue colors which make easier reading the code. Is there any command to insert in the .vimrc file to tell vim to increase the character limit and hence avoid the massive red marking?

Thanks!

chw21
  • 7,970
  • 1
  • 16
  • 31
fsaizpoy
  • 149
  • 1
  • 2
  • 8
  • Have you tried `let fortran_have_tabs=1`? Otherwise, check here: http://stackoverflow.com/questions/235439/vim-80-column-layout-concerns – Ross May 19 '15 at 22:07
  • 4
    Have you set `let fortran_free_source=1`? – casey May 19 '15 at 22:39

1 Answers1

2

The issue is that vim assumes a fixed source form by default. You need to add the following to your .vimrc :

let fortran_free_source=1

Here is an excerpt from :help fortran.vim :

Fortran code can be in either fixed or free source form. Note that the syntax highlighting will not be correct if the form is incorrectly set.
When you create a new fortran file, the syntax script assumes fixed source form. If you always use free source form, then
:let fortran_free_source=1
in your .vimrc prior to the :syntax on command. If you always use fixed source form, then
:let fortran_fixed_source=1
in your .vimrc prior to the :syntax on command.

veryreverie
  • 2,871
  • 2
  • 13
  • 26