vim配置

配置文件内容

所有用户生效 修改 /etc/vimrc 仅在当前用户下生效 在用户目录下新建文件为 .vimrc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"设置编码
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8

"显示行号
set nu
set number

"cursorline的缩写形式
set cursorline
set cul

"突出显示当前列
"set cursorcolumn
"set cuc

"启用鼠标
set mouse=a
set selection=exclusive
set selectmode=mouse,key

"显示括号匹配
set showmatch

"设置Tab长度为4空格
set tabstop=4
"设置自动缩进长度为4空格
set shiftwidth=4
"继承前一行的缩进方式,适用于多行注释
set autoindent

"设置粘贴
set paste

"显示tab和空白符,方便定位错误
set listchars=tab:>-,trail:-

"总是显示状态栏
set laststatus=2
"显示光标当前位置
set ruler