Vim does not recognize columns beyond 72 with code fortran90

I am editing fortran90 code with vim. Please note that I am working with a * .f90 file, not * .f. vim recognizes nothing but column 72 as legal code. This is an annoying problem because if a quote opens, say, in column 50, but doesn't close before column 80, then vim colors all of the following lines as part of the same quote That would make sense if I were working with the old fortran77 file, but I clearly don't know. Is there a way to convince vim to recognize the code behind column 72?

+4
source share
2 answers

if I create a new .f90 file syntax, it stands out as if it were fortran 77 (fixed line length, comments in the first column, code on the 6th column, etc. etc.), and not modern free fortran format.

:let b:fortran_fixed_source=0
:set syntax=fortran

does the trick to get vim to correctly highlight it.

+1
source

This may be due to the variable "synmaxcol". If you run

:set synmaxcol?

At the vim command line, what will you return? Setting this option above may fix the problem. It is usually set low because vim can get lagged when the syntax highlights very long lines, such as those found in XML.

0
source

Source: https://habr.com/ru/post/1679466/


All Articles