Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid vim marking long lines as red when a string exceeds the 73-character column limit

Tags:

vim

fortran

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!

like image 841
fsaizpoy Avatar asked Oct 15 '25 16:10

fsaizpoy


1 Answers

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.

like image 165
Morgan Ruesch Avatar answered Oct 17 '25 10:10

Morgan Ruesch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!