vim无法使用fortran90代码识别超过72列

vim无法使用fortran90代码识别超过72列

本文介绍了vim无法使用fortran90代码识别超过72列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用vim编辑一个fortran90代码.请注意,我正在使用* .f90文件,而不是* .f. vim不会将第72列之外的任何内容都识别为合法代码.这是一个令人讨厌的问题,因为如果在第50列处打开了引号,但直到第80列才关闭引号,则vim会将以下所有行着色为同一引号的一部分.如果我使用的是旧的fortran77文件,这将是有道理的,但我显然不是.有什么方法可以说服vim识别超出第72列的代码?

I am editing a fortran90 code with vim. Note that I'm working with a *.f90 file, not *.f. vim doesn't recognize as legitimate code anything beyond column 72. This is an annoying problem because if a quote is opened at, say, column 50 but not closed until column 80, then vim colors all the following lines as part of the same quote. This would make sense if I was working with an old fortran77 file, but I'm clearly not. Is there any way to convince vim to recognize code beyond column 72?

推荐答案

如果我创建一个新的.f90文件,语法将突出显示,就好像它是fortran 77(固定行长,第一个列中的注释,第6个列中的代码等)等等),而不是现代的自由格式fortran.

if I create a new .f90 file syntax is highlighted as if it is fortran 77 (fixed line length, comments in first col, code at 6th col, etc etc) rather than modern free form fortran.

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

可以使vim正确突出显示它.

does the trick to get vim highlighting it correctly.

这篇关于vim无法使用fortran90代码识别超过72列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 01:38