Vim简单配置

source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\ ' . arg3
  if exists('l:shxq_sav')
    let &shellxquote=l:shxq_sav
  endif
endfunction

" User config
color elflord " 设置配色
set nocompatible
syntax on " 设置语法高亮
set number " 设置显示行号
set cursorline
set ruler " 设置标尺
set softtabstop=4
set tabstop=4 " 设置tab键长度
set nobackup " 设置不自动备份文件
set autochdir
set hlsearch " 设置搜索结果高亮
set incsearch
set nowrapscan
set magic
" set smartindent " 设置智能缩进
set laststatus=2
set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ %c:%l/%L%)\
" Set file encoding " 设置文件编码
set langmenu=zh_CN  
let $LANG = 'zh_CN.UTF-8'  
source $VIMRUNTIME/delmenu.vim  
source $VIMRUNTIME/menu.vim  
source $VIMRUNTIME/vimrc_example.vim  
source $VIMRUNTIME/mswin.vim  
behave mswin

set fileencodings=utf-8
set fileencoding=utf-8
set termencoding=utf-8
" no swp and no backup
set noundofile
set nobackup
set noswapfile " 设置取消交换区文件

你可能感兴趣的:(Vim简单配置)