fortran_free_source中断vim中的注释语法着色 [英] fortran_free_source interrupts comment syntax coloring in vim

查看:251
本文介绍了fortran_free_source中断vim中的注释语法着色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读fortran 77代码(我讨厌!),为了让vim在第72行之后奇怪地着色,我包括 let fortran_free_source = 1

I am reading fortran 77 code (which I hate!) and in order to keep vim from coloring the lines weirdly after line 72, I included let fortran_free_source=1 before the syntax on line in my .vimrc.

但是,这样做之后,所有以'C'开头的注释'或'c'不是彩色的注释应该着色。只有以!开头的注释才正确着色。我应该如何编辑我的.vimrc文件,使旧的fortran风格的注释正确着色?

However, after doing this, all comments which begin with 'C' or 'c' are not colored the way comments should be colored. Only comments which begin with '!' are colored correctly. How should I edit my .vimrc file so that comments in the old fortran style are colored correctly?

推荐答案

$ b添加到你的.vimrc let fortran_have_tabs = 1 ,应该摆脱它。唯一的副作用是不再突出显示标签。

New answer: Add to your .vimrc let fortran_have_tabs=1 that should get rid of it. The only side effect will be that tabs are no longer highlighted.

旧答案:

知道任何直接的解决方案,但脏的黑客将复制fortran.vim在你的语法文件夹,并删除332行:

I wouldn't know any direct solution for this but a dirty hack would be to copy the fortran.vim in your syntax folder and remove line 332:

    syn match fortranSerialNumber       excludenl "^.\{73,}$"lc=72

调用它myfortran.vim(在你的〜/ .vim / syntax文件夹),你可以使用set syntax = myfortran。我确定必须有一个更优雅的方式,但这应该工作。

if you call it myfortran.vim (in your ~/.vim/syntax folder) you can use set syntax=myfortran. I'm sure there must be a more elegant way but this should work.

如果你把它保存为fortran.vim,那么只有〜/ .vim / syntax中的文件将被加载,而不是/ usr / yourvimdir /

If you leave it as fortran.vim then only the file in ~/.vim/syntax will be loaded and not the one in /usr/yourvimdir/

这篇关于fortran_free_source中断vim中的注释语法着色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆