Vim highlighting weird parts of FORTRAN

前端 未结 3 2095
甜味超标
甜味超标 2021-02-06 02:13

I am using VIM theme molokai, if that makes any difference.

I have been learning FORTRAN lately and when I write a FORTRAN program using VIM, I have weird coloring depen

3条回答
  •  眼角桃花
    2021-02-06 03:15

    Vim was using fixed-format/punchcard when I created a new .f90 file. In order to differentiate it, I found this. I copied it to my ~/.vim/syntax/ directory and added the following lines to my .vimrc (also specified at following link)

    nmap  :set syntax=fortran:let b:fortran_fixed_source=!b:fortran_fixed_source:set syntax=text:set syntax=fortran
    nmap  :filetype detect
    

    Allowing me to bind Shift-F to switch formats, and Ctrl-F to auto detect.

提交回复
热议问题