.vimrc配置文件

分享一下作者的.vimrc配置文件:

 

" 显示行号
set number

" 设置tab宽度
set tabstop=4

" 设置自动对齐空格数
set shiftwidth=4

" 按退格键时可以一次删除4个空格
set softtabstop=4

" 设置编码方式
set encoding=utf-8

" 关闭vi的一致性模式,避免以前版本的一些Bug和局限
set nocompatible

" 让vim记忆上次编辑的位置
autocmd BufReadPost *
            \ if line("'\"")>0&&line("'\"")<=line("$") |
            \    exe "normal g'\"" |
            \ endif

" 显示tab键
set list
set listchars=tab:>-,trail:-

" 让vim显示行尾的空格
highlight WhitespaceEOL ctermbg=red guibg=red
match WhitespaceEOL /\s\+$/

" 高亮显示光标所在行
set cursorline

" 自动语法高亮
syntax on

 

posted on 2019-06-15 10:53  Alvin2012  阅读(113)  评论(0编辑  收藏  举报

导航