Heim  >  Fragen und Antworten  >  Hauptteil

vim - 配置vi后,提示"the command is not available in this version: syntax on"

ubuntu下,配置了.vimrc文件,然后用vi命令编辑文件,打开的时候提示

Sorry, the command is not available in this version: syntax on

错误所在行的内容是syntax on,这是为什么呢?

阿神阿神2738 Tage vor792

Antworte allen(2)Ich werde antworten

  • 怪我咯

    怪我咯2017-04-21 10:57:10

    Ubuntu自带的vim是个精简版,当然就没有syntax配置。
    你只需要安装个完整版的vim就行了

    $ sudo apt-get install vim

    Antwort
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-21 10:57:10

    用 vim 才有 syntax 支持的,vi 命令调用 vim 会运行再 vi 兼容模式。我 google 了一下 vi 和 vim,给你第一篇 http://www.songzi.org/blog/article.as...

    @holee 在评论里提到 ubuntu 下 vi 就是 vim,由于我是 Arch 用户,不用 ubuntu,所以不太清楚。

    总之,使用 vim 调用编辑器,并且确保 ~/.vimrc 还有 set nocompatible 以保证没有运行在 vi 兼容模式。

    Antwort
    0
  • StornierenAntwort