From fc8b32cd178158a0a6f9707d30c8f1f896b1feea Mon Sep 17 00:00:00 2001 From: "Ein Verne(einverne)" Date: Mon, 4 May 2015 13:53:40 +0800 Subject: [PATCH] fix --- _vimrc | 29 +++++++++++++++++++++++++++-- python_vimrc | 2 +- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/_vimrc b/_vimrc index 9e9b83f..bcd4db9 100644 --- a/_vimrc +++ b/_vimrc @@ -12,11 +12,22 @@ source $VIMRUNTIME/mswin.vim " => General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Sets how many lines of history VIM has to remember -set history=700 +set history=1000 " set to auto read when a file is changed outside set autoread +" with a map leader it's possible to do extra key combinations +" like w saves the current file +let mapleader = "," +let g:mapleader = "," + +" fast saving +nmap w :w! + +"编辑vimrc之后,重新加载 +autocmd! bufwritepost _vimrc source $VIM/_vimrc + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => VIM user interface """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -26,6 +37,9 @@ set scrolloff=8 " 如下命令使鼠标用起来象微软 Windows behave mswin +" 高亮整行 +set cursorline + " always show current position set ruler " height of the command bar @@ -52,6 +66,17 @@ set magic set showcmd +if has('multi_byte_ime') + "未开启IME时光标背景色 + hi Cursor guifg=bg guibg=Orange gui=NONE + "开启IME时光标背景色 + hi CursorIM guifg=NONE guibg=Skyblue gui=NONE + " 关闭Vim的自动切换IME输入法(插入模式和检索模式) + set iminsert=0 imsearch=0 + " 插入模式输入法状态未被记录时,默认关闭IME + "inoremap :set iminsert=0 +endif + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Colors and Fonts """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -176,7 +201,7 @@ autocmd BufWrite *.py :call DeleteTrailingWS() autocmd BufWrite *.coffee :call DeleteTrailingWS() set diffexpr=MyDiff() -function MyDiff() +function! MyDiff() let opt = '-a --binary ' if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif diff --git a/python_vimrc b/python_vimrc index fc00b9e..54b712a 100644 --- a/python_vimrc +++ b/python_vimrc @@ -25,7 +25,7 @@ au BufRead,BufNewFile *py,*pyw,*.c,*.h set tabstop=8 " C: tabs (pre-existing files) or 4 spaces (new files) au BufRead,BufNewFile *.py,*pyw set shiftwidth=4 au BufRead,BufNewFile *.py,*.pyw set expandtab -fu Select_c_style() +fu Select_c_style!() if search('^\t', 'n', 150) set shiftwidth=8 set noexpandtab