gpt4 book ai didi

ubuntu - Vim 突出问题

转载 作者:行者123 更新时间:2023-12-04 19:15:30 26 4
gpt4 key购买 nike

我在 Ubuntu 16.04 LTS 下使用 vim 使用 nesC 语言。

我的问题是当我编辑代码时,突出显示工作正常(如第一张图片),但当我保存、退出并再次打开文件时,突出显示消失(如第二张图片)。

enter image description here
enter image description here

非常感谢大家!

PS:我已经设置了语法。当我阅读其他人的代码时,突出显示按预期工作。

最佳答案

vim突出显示基于文件扩展名的现有文件的语法(您使用哪一个?)。幸运的是,有一些扩展可以让你修复它。大概this就是这样的延伸。 This也很有帮助。简而言之,它们描述了一种方法来突出显示您选择的扩展,例如用于 C++。从帖子:

After digging around I found the solution. Add the following to ~/.vimrc (the vim configuration file):

syntax on
filetype on
au BufNewFile,BufRead *.lmx set filetype=xml

关于ubuntu - Vim 突出问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39575250/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com