VIM配置文件

VIM配置文件样本:

" file setting
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936
"set ambiwidth=double

" syntax highlight
syntax enable
syntax on

" highlight when search
set hlsearch
set incsearch

" 显示命令
set showcmd

" 去掉讨厌的vi一致性模式
set nocompatible

" check file type
filetype on

" no backup file
set nobackup
set nowritebackup
set noswapfile

" support mouse
if(has("mouse"))
set mouse=a
endif

" display line number
set nu!
"set number

" Tab width
set tabstop=4
set softtabstop=4
set expandtab

" 自动缩进 
set sw=4
"set shiftwidth=4

" C/C++ style autoindent
set cin
set smartindent
" 设定C/C++风格自动缩进的选项
set cino=:0g0t0(sus

" open normal file autoindent
set ai
"set autoindent

" 在编辑过程中,在右下角显示光标位置的状态行
set ruler

" 显示匹配括号
set showmatch

" 在insert模式下能用删除键进行删除
set backspace=indent,eol,start
"set backspace=start,indent,eol

" 代码折叠,命名za
set foldmethod=syntax
set foldlevel=100   " 启动vim时不要自动折叠代码

" 设置字体
"set guifont=courier\10

" 当右键点击窗口时,弹出快捷菜单
"set mousemodel=popup

" 自动换行
if(has("gui_running")) " 图形界面下的设置
    " 指定不折行。如果一行太长,超过屏幕宽度,则向右边延伸到屏幕外面
    set nowrap

    " 添加水平滚动条。如果指定了不折行,该项很有用
    set guioptions+=b
else " 字符界面下的设置
    set wrap
endif


set noerrorbells
set novisualbell


你可能感兴趣的:(vim,vimrc)