在 Vim 中编辑 Fortran 时消除制表符空间的红色突出显示
当我编写 Fortran 代码并使用制表符进行缩进时,Vim 以红色突出显示这些空格,因为在旧版 Fortran 中,前 6 列是特殊的,为标签/行号和延续符号保留。我怎样才能让 Vim 停止这样做呢?
谢谢。
When I code Fortran, and use tabs for indentation, Vim highlights those spaces in red, because in older Fortran the first 6 columns were special and reserved for labels/line numbers and continuation symbols. How can I make Vim stop doing that?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
停止突出显示 Tab
开始突出显示 Tab
stop highlighting Tab
start highlighting Tab
实际上,制表符不是 Fortran 字符集的一部分,可移植代码应该避免使用它。因此,我建议将 vim 配置为使用空格而不是制表符进行缩进,请参阅“expandtab”选项。
Actually, tab is not part of the Fortran character set, and portable code should avoid it. So instead I'd recommend to configure vim to use spaces instead of tabs for indentation, see the "expandtab" option.
将以下内容放入 .vimrc 中:
文档中有解释: http://vimdoc.sourceforge.net/ htmldoc/syntax.html
Put the following in your .vimrc:
Explained in the documentation: http://vimdoc.sourceforge.net/htmldoc/syntax.html