打开Vim。
- :e d:\Program\ Files\Vim\_vimrc
按"G"到最底部。
按"i"进入Insert Mode。
设置gVim菜单英文。
- " set the menu and the message English
- set langmenu=en_US
- let $LANG = "en_US"
- source $VIMRUNTIME/delmenu.vim
- source $VIMRUNTIME/menu.vim
设置背景和字体颜色。
- " set background black and font gray
- colo koehler
设置英文字体为MONACO,11号大小。
- " set font as MONACO
- set guifont=MONACO:h11:cANSI
设置屏幕初始大小。
- " set starting window size
- set lines=23 columns=100
设置显示行号。
- " show line number
- set nu
设置代码中的中文不会乱码。
- " set Chinese characters in coding correct
- set fileencodings=utf-8,gbk,big5
设置缩进为4个空格。
- " Number of spaces to use for each step of (auto)indent.
- " set indent as 4 spaces
- " set sw=4
- set shiftwidth=4
按<Tab>时,用空格符(而不是制表符)缩进。
- " In Insert mode: Use the appropriate number of spaces to insert a <Tab>.
- " Spaces are used in indents with the '>' and '<' commands and when 'autoindent' is on.
- set expandtab
- set autoindent
按<BS>删除缩进时,删除4个空格。
- " Number of spaces that a <Tab> counts for while performing editing
- " operations, like inserting a <Tab> or using <BS>.
- set softtabstop=4
根据文件类型载入管缩进的文件。
- " enable loading the indent file for specific file types
- filetype indent on
按":wq"保存退出。
转载于:https://blog.51cto.com/andyq/1087484