打开Vim。

 
  
  1. :e d:\Program\ Files\Vim\_vimrc 

按"G"到最底部。

按"i"进入Insert Mode。

设置gVim菜单英文。

 
  
  1. " set the menu and the message English 
  2. set langmenu=en_US 
  3. let $LANG = "en_US" 
  4. source $VIMRUNTIME/delmenu.vim 
  5. source $VIMRUNTIME/menu.vim 

设置背景和字体颜色。

 
  
  1. " set background black and font gray 
  2. colo koehler 

设置英文字体为MONACO,11号大小。

 
  
  1. " set font as MONACO 
  2. set guifont=MONACO:h11:cANSI 

设置屏幕初始大小。

 
  
  1. set starting window size 
  2. set lines=23 columns=100 

设置显示行号。

 
  
  1. " show line number 
  2. set nu 

设置代码中的中文不会乱码。

 
  
  1. set Chinese characters in coding correct 
  2. set fileencodings=utf-8,gbk,big5 

设置缩进为4个空格。

 
  
  1. " Number of spaces to use for each step of (auto)indent. 
  2. set indent as 4 spaces 
  3. " set sw=4 
  4. set shiftwidth=4 

按<Tab>时,用空格符(而不是制表符)缩进。

 
  
  1. In Insert mode: Use the appropriate number of spaces to insert a <Tab>. 
  2. " Spaces are used in indents with the '>' and '<' commands and when 'autoindent' is on
  3. set expandtab 
  4. set autoindent 

按<BS>删除缩进时,删除4个空格。

 
  
  1. " Number of spaces that a <Tab> counts for while performing editing 
  2. " operations, like inserting a <Tab> or using <BS>. 
  3. set softtabstop=4 

根据文件类型载入管缩进的文件。

 
  
  1. " enable loading the indent file for specific file types 
  2. filetype indent on 



按":wq"保存退出。