vim7.4在Win8下的安裝及簡單配置

Solon Tan發表於2014-01-02

軟體環境

  1. vim74
  2. git
  3. vim中文幫助

vundle安裝——外掛管理軟體

  1. cd vim所在路徑/vimfiles/bundle
  2. git clone https://github.com/gmarik/vundle.git
  3. 修改vimrc檔案,預設在vim所在路徑/_vimrc
  4. 修改完畢後執行:BundleInstall,檢查是否安裝完畢
      set nocompatible              " be iMproved
      filetype off                  " required!

      set rtp+=~/.vim/bundle/vundle/
      call vundle#rc()

      " let Vundle manage Vundle
      " required!
      Bundle 'gmarik/vundle'
      filetype plugin indent on     " required!

安裝主題

 Bundle 'altercation/vim-colors-solarized'

 """solarized"""
 syntax enable
 set background=dark
 colorscheme solarized

vim字型設定

 set guifont=Yahei\ Mono:h14

gvim亂碼修正

" ===solve encode===
if has("multi_byte")
  if &termencoding == ""
    let &termencoding = &encoding
  endif
  set encoding=utf-8
  if $LANG == "zh_CN"
    if &encoding == "utf-8"
        language message zh_CN.UTF-8
    elseif &encoding == "cp936"
        language message zh_CN.cp936
    endif
  endif
  set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,chinese,euc-jp,euc-kr,latin1
  set fileencoding=chinese
endif
" for menu and right-mouse menu
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
" for console
language message zh_CN.utf-8

Ctrl + V用於模式切換

$vim/mswin.vim
" CTRL-V and SHIFT-Insert are Paste
" map "+gP "註釋掉該行即可

縮排由tab換成空格,以及自動縮排的時候顯示

" ===set indent===
set expandtab     " use space instead of tab.
set tabstop=4     " space num is 4
set shiftwidth=4  " auto-indent
set list          " show tab
set listchars=tab:>-,trail:- " show tab and space as >- and -
set softtabstop=4

相關文章