vi编辑器中关键字高亮设置、行号设置

vi编辑器十分强大,学习,与大家分享

今天分享一点

vi编辑器中关键字高亮设置、行号设置

1.打开终端输入如下命令

 cd /usr/share/vim

 sudo vim vimrc

2.需要获取root密码,不可见,如果输入错误会出现错误提示

Password:

Sorry, try again.

Password:

Sorry, try again.

Password:

Sorry, try again.

sudo: 3 incorrect password attempts


3.进入配置文件之后根据自己需要进行配置

  1 " Configuration file for vim

  2 set modelines=0     " CVE-2007-2438

  3 

  4 " Normally we use vim-extensions. If you want

  5 " remove change the following statements

  6 set nocompatible    " Use Vim defaults instea

  7 set backspace=2     " more powerful backspaci

  8 set ai" auto indenting

  9 set history=100 "keep 100 lines of history

 10 set ruler "show the cursor position

 11 syntax on"syntax highlighting

 12 set hlsearch

 13 set number

 14 

 15 

4.双引号后面是注释,可加可不加

5.保存文件shift+zz退出

6.再次运行sudo vim vimrc

ok



你可能感兴趣的:(vi编辑器中关键字高亮设置、行号设置)