mac系统自带vi编辑器,但其初始设置比较粗陋,连常用的关键字高亮都没有。以下方法可以解决此问题(需有root密码): 1、打开terminal,敲入以下命令: cd /usr/share/vim sudo vim vimrc 2、编辑配置文件 在set backspace=2所在行后面新建一行,并键入以下文字: (双引号后面是注释,可不加) set ai " auto indenting
set history=100 " keep 100 lines of history
set ruler " show the cursor position
syntax on " syntax highlighting
set hlsearch " highlight the last searched term
filetype plugin on " use the file type plugins 3、保存文件,退出,并再次键入sudo vim vimrc命令 搞定。