mac下vi高亮

 # 问题描述丨Problem Description

Mac OS并不像大多数Linux发行版vi/vim默认自带语法着色高亮显示(通常Linux可通过编辑/etc/vimrc进行全局设置或~/vimrc进行单用户设置),使用vi/vim编辑文件时很不方便,如何解决 ?
Mac OS isn’t like other most Linux distributions syntax highlighting is enabled by default(generally, edit /etc/vimrc to set global configuration or edit ~/vimrc for personal), this makes quite uncomfortable for using, but how to solve this case?

 # 解决方案丨The Solution

Step 1,编辑文件/usr/share/vim/vimrc 丨  Edit file /usr/share/vim/vimrc
Step 2,  在set backspace=2下插入如下配置 | configure the following chars under the line of ‘set backspace=2’
Step 3,再次打开该文件(实际上任意文件都可以)会发现已自动着色,见下图。 | reopen the file(any file in fact) and you’ll find the syntax highlighted automatically,  see the following image.
小泥巴的博客

发表评论

电子邮件地址不会被公开。 必填项已用*标注