vim - 配置vi后,提示"the command is not available in this version: syntax on"
阿神
阿神 2017-04-21 10:55:10
0
2
815

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

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

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

阿神
阿神

闭关修行中......

reply all(2)
刘奇

The vim that comes with Ubuntu is a streamlined version, and of course there is no syntax configuration.
You only need to install a full version of vim

$ sudo apt-get install vim
伊谢尔伦

Only vim has syntax support. When the vi command calls vim, it will run in vi compatibility mode. I googled vi and vim and gave you the first article http://www.songzi.org/blog/article.as...

@holee mentioned in the comments that vi under ubuntu is vim. Since I am an Arch user and do not use ubuntu, I am not sure.

In short, use vim to call the editor, and make sure ~/.vimrc also has set nocompatible to ensure it is not running in vi compatibility mode.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template