" Configuration file for vim set modelines=0 " CVE-2007-2438 " Normally we use vim-extensions. If you want true vi-compatibility " remove change the following statements set nocompatible " Use Vim defaults instead of 100% vi compatibility set backspace=2 " more powerful backspacing syntax on " 語法高亮 autocmd InsertLeave * se nocul autocmd InsertEnter * se cul " 用淺色高亮當前行 set smartindent " 智能對齊 set autoindent " 自動對齊 set confirm " 在處理未保存或只讀文件的時候,彈出確認 set tabstop=4 " Tab鍵的寬度 set softtabstop=4 set shiftwidth=4 " 統一縮進爲4 set noexpandtab " 不要用空格代替製表符 set number " 顯示行號 set history=50 " 歷史紀錄數 set hlsearch set incsearch " 搜索逐字符高亮 set gdefault " 行內替換 set encoding=utf-8 set fileencodings=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936,utf-16,big5,euc-jp,latin1 " 編碼設置 colorscheme torte " 設置顏色主題 "set guifont=Menlo:h16:cANSI " 設置字體 set langmenu=zn_CN.UTF-8 set helplang=cn " 語言設置 set cmdheight=2 " 命令行(在狀態行)的高度,默認爲1,這裏是2 set ruler " 在編輯過程當中,在右下角顯示光標位置的狀態行 set laststatus=2 " 老是顯示狀態行 set showcmd " 在狀態行顯示目前所執行的命令,未完成的指令片斷亦會顯示出來 set scrolloff=3 " 光標移動到buffer的頂部和底部時保持3行距離 set showmatch " 高亮顯示對應的括號 set matchtime=5 " 對應括號高亮的時間(單位是十分之一秒) set autowrite " 在切換buffer時自動保存當前文件 set wildmenu " 加強模式中的命令行自動完成操做 set linespace=2 " Don't write backup file if vim is being called by "crontab -e" au BufWrite /private/tmp/crontab.* set nowritebackup nobackup " Don't write backup file if vim is being called by "chpass" au BufWrite /private/etc/pw.* set nowritebackup nobackup