非 root 用户在 ~ 目录下,新建 .vimrc 文件:
cd ~
vim .vimrc
写入以下指令:
set number " Set the line number
set tabstop=4 " Set an indent to account for 4 spaces
syntax on " 打开语法高亮
set cursorline " Settings to highlight the current row
set st=4 " Set the width of the soft tab to 4 spaces
set hlsearch " Enable Search Highlight
set autoindent " 开启自动缩进功能,让新的行与前一行的缩进保持一致
以上是我常用的,还有很多其他功能,附个链接: