本身用了好久的vimrc,拿出來和你們分享!順便求高手斧正部分錯誤!
如:
一、CTRL+s是能夠保存的!可是,若是沒有文件名,則會報錯,也沒法保存!求高手改正此處錯誤!
二、vimrc中已經設置了set autoindent;可是,在使用中依然沒法自動縮進,必須在打開vim以後,在命令行輸入:set autoindent方可實現自動縮進的功能!
- cd D:\wamp\www
- """""""""""""""""
- " => General
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " => When started as "evim", evim will not do these settings
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- set nocompatible
- source $VIMRUNTIME/vimrc_example.vim
- source $VIMRUNTIME/mswin.vim
- behave mswin
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- if v:progname =~? "evim"
- finish
- endif
-
- autocmd!
-
- " 共享外部剪貼板
- set clipboard+=unnamed
-
- " 按,v查看_vimrc
- nmap <leader>v :e $VIM/_vimrc<cr>
- "快速保存
- nmap <leader>w :w!<cr>
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " => Local Variable
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- let head_flag=1
- let copen_flag=0
- let nowrap_flag=0
- let xxd_flag=0
- let virtual_flag=0
-
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " => Setting VIM and VIMRUNTIME
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- if has("win32")
- let $VIM = $PROGRAMFILES."\\Vim"
- let $VIMRUNTIME = $PROGRAMFILES."\\Vim\\vim73"
- let $VIMRC = $PROGRAMFILES."\\Vim\\_vimrc"
- "let $DESKTOP = $USERPROFILE."\\桌面"
- elseif has("unix")
- let $VIM = $HOME."/usr/mzy/vim"
- let $VIMRUNTIME = $HOME."/usr/mzy/vim/share"
- let $VIMRC = $HOME."/.vimrc"
- let $DESKTOP = $HOME
- else
- endif
-
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " => Setting encodings
- " => Vim 逐一探測即將打開的文件的字符編碼方式
- " => Vim 內部使用的字符編碼方式: encoding
- " => Vim 中當前編輯的文件的字符編碼方式: fileencoding
- """""""""""""""""""""""
- set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
-
- set encoding=utf-8
- language messages zh_CN.utf-8
- "set printencoding=cp936
-
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " => termencoding
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- if v:lang =~ "^zh_CN"
- set termencoding=cp936
- elseif v:lang =~ "^zh_TW"
- set termencoding=big5
- elseif v:lang =~ "^ko"
- set termencoding=euc-kr
- elseif v:lang =~ "^ja_JP"
- set termencoding=euc-jp
- endif
-
- """""""""""""""""""
- " => Reload menu
- """""""""""""""""""
- if has("gui_running")
- source $VIMRUNTIME/delmenu.vim
- set langmenu=zh_CN.UTF-8
- source $VIMRUNTIME/menu.vim
- endif
-
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " => Last cursor position
- """""""""""""""""""""""
- autocmd BufReadPost *
- \ if line("'\"") > 0 && line ("'\"") <= line("$") |
- \ exe "normal g'\"" |
- \ endif |
-
- """""""""""""""""
- " => Choose binary mode
- """""""""""""""
- set nobin
-
- """"""""""""
- " => Choose VI's compatible mode
- """""""""""""""
- set nocompatible
-
- """""""""""""""
- " => Set begin path
- """"""""""""""""
- if has("win32") && has("gui_running")
- "cd $DESKTOP
- elseif has("unix")
- elseif has("mac")
- endif
-
- """"""""""""""
- " => Set path
- """"""""""""""
- if has("win32")
- set path=.,,
- elseif has("unix")
- set path=.,/usr/local/include,/usr/include
- set path+=~/batch/include,~/online/include
- elseif has("mac")
- set path=.,/emx/local/include
- endif
-
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " => Set shell
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- if has("win32")
- set shell=cmd