VIM配置文件备份2015年11月16日

vim配置文件_vimrc备份,通过以下配置的设置,可以使你的VIM环境更加舒适好用。

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set nobackup
set nu
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
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
set fileencodings=utf-8,gbk,gb18030,gk2312
set go= "设置不显示图形按纽
syntax on "语法高亮
set ruler "显示标尺
set showcmd "输入的命令显示出来,看的清楚些
set completeopt=preview,menu "设置代码补全
set clipboard+=unnamed "共享剪贴板
set cursorline "突出显示当前行
set noeb "去掉输入错误的提示声音
set confirm "在处理未保存或只读文件的时候,弹出确认
set autoindent "设置自动缩进
set cindent
set tabstop=4 "TAB键的宽度
"统一缩进为4
set softtabstop=4
set shiftwidth=4
set noexpandtab "不要用空格代替制表符
set smarttab "在行和段开始处使用制表符
set laststatus=2 "总是显示状态栏
filetype on "侦测文件类型
filetype plugin on "载入文件类型插件
" 映射全选+复制 ctrl+a
map <C-A> ggVGY
"映射新建文件 ctrl+N
map <C-N> :new<CR>

"映射保存文件 ctrl+S
map <C-S> :w<CR>
"自动补全括号
:inoremap ( ()<ESC>i
:inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap { {<CR>}<ESC>O
:inoremap } <c-r>=ClosePair('}')<CR>
:inoremap [ []<ESC>i
:inoremap ] <c-r>=ClosePair(']')<CR>
:inoremap " ""<ESC>i
:inoremap ' ''<ESC>i
function! ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<Right>"
else
return a:char
endif
endfunction

 

你可能感兴趣的:(VIM配置文件备份2015年11月16日)