2017/04/05

我的最新的 VIMRC 文件, 备份自用!


source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/gvimrc_example.vim
filetype off                 " required before add more bundles
set rtp+=$VIM/rust.vim
filetype plugin indent on    " required

" Don't need ugly files
set nobackup
set noundofile

" Other settings
set ruler
set number
set wildmenu
set showcmd
set laststatus=2
set cmdheight=1

" Tab/Space related
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4

"colorscheme oceandeep
colorscheme evening

if has("multi_byte")
  set encoding=utf-8
  "let &termencoding = &encoding
  set termencoding=unicode
  " Set default encoding as UTF-8 with BOM
  setglobal fileencoding=utf-8 "bomb "bomb introduce problem for *nix
  set fileencodings=ucs-bom,utf-8,gb18030,cp936,cp950,latin1
  " Walkaround the encoding problem for fenc=utf-8 && enc=ucs-2
  augroup i18n
      autocmd!
      autocmd BufReadPost * if &fileencoding == "utf-8" | let &encoding = &fileencoding | endif
  augroup END
endif

" Enable the Chinese characters
set guifont=Consolas:h11:cANSI,NSimSun:h12:cGB2312
set guifontwide=NSimSun:h12:cGB2312

" IME 
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

" Set the swap file location
set dir=c:\\temp

" display the syntax name under the cursor
map  :echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "name")

" We can navigate the list by using the  and 
map  :cnext
map  :cprevious

" Let's help the tab navigation a little
map  :tabprevious
map  :tabnext

" Tlist
map  :Tlist
set tags=./tags,../tags,../../tags,../../../tags
set path+=./,../,../../,../../../

" 设定 windows 下 gvim 启动时最大化
"if has("gui_running")
"    if has("win32")
"        autocmd GUIEnter * simalt ~x
"    endif
"endif

发表评论