vim常用配置

vim常用配置

vim 是程序员最喜欢的编辑器,没有之一。编辑 ~/.vimrc 可以设置一些默认的vim属性,包括缩进、显示行数等等。下面这个配置是我比较喜欢的,拿出来给大家共享。

" Configuration file for vim
set modelines=0     "CVE-2007-2438
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible    " Use Vim defaults instead of 100% vi compatibility
set backspace=2     " more powerful backspacing
" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup nobackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup nobackup
syntax on
" 语法高亮
autocmd InsertLeave * se nocul
autocmd InsertEnter * se cul 
" 用浅色高亮当前行
set tabstop=4
" Tab键的宽度
set softtabstop=4
set shiftwidth=4
"  统一缩进为4
set number
" 显示行号
"colorscheme pablo
colorscheme desert
" 设置颜色主题
set ruler
" 在编辑过程中,在右下角显示光标位置的状态行
set scrolloff=5
" 光标移动到buffer的顶部和底部时保持3行距离
set cursorline
set cindent

你可能感兴趣的:(Linux)