ubuntu下,配置了.vimrc文件,然后用vi命令编辑文件,打开的时候提示
Sorry, the command is not available in this version: syntax on
错误所在行的内容是syntax on
,这是为什么呢?
怪我咯2017-04-21 10:57:10
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
伊谢尔伦2017-04-21 10:57:10
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.