標籤:des blog http color os io 使用 ar for
一、真正解決了UTF-8中文亂碼的各種問題(菜單亂碼,內容亂碼,提示資訊亂碼),不用擔心WIN用預設編碼寫的東西在Linux亂碼,或在Linux(zh_CN.UTF-8時)寫的東西在WIN下亂碼。在Arch、CentOS 6.2、win 7 SP1,使用GVIM 7.3.46測試通過,無問題。二、添加了zenconding,色彩配置包,JS,自動補全外掛程式,使前端開發更快速。三、使用時將vimfiles、_vimrc覆蓋至安裝目錄即可。四、參考了論壇裡一些網友的設定,並附上其教程,表示感謝。五、VIM博大精深(對我來說),如有疑惑,請參考附件手冊。僅此而已。
附上一張圖
?1. [圖片] VIM設定檔
?2. [代碼][其他]代碼
set nocompatible
"source $VIMRUNTIME/vimrc_example.vim "軟體安裝預設,source入vimrc_example.vim後,在設定encoding=utf-8時,將導致中文菜單亂碼難以解決
source $VIMRUNTIME/mswin.vim
behave mswin
" 字型、字型大小
set guifont=Courier\ New:h13
" 編碼設定
set encoding=utf-8
set langmenu=zh_CN.UTF-8
language message zh_CN.UTF-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set ffs=unix,dos,mac
set ff=unix "設定檔案格式為UNIX格式
set diffexpr=MyDiff()
function MyDiff()
let opt = ‘-a --binary ‘
if &diffopt =~ ‘icase‘ | let opt = opt . ‘-i ‘ | endif
if &diffopt =~ ‘iwhite‘ | let opt = opt . ‘-b ‘ | endif
let arg1 = v:fname_in
if arg1 =~ ‘ ‘ | let arg1 = ‘"‘ . arg1 . ‘"‘ | endif
let arg2 = v:fname_new
if arg2 =~ ‘ ‘ | let arg2 = ‘"‘ . arg2 . ‘"‘ | endif
let arg3 = v:fname_out
if arg3 =~ ‘ ‘ | let arg3 = ‘"‘ . arg3 . ‘"‘ | endif
let eq = ‘‘
if $VIMRUNTIME =~ ‘ ‘
if &sh =~ ‘\<cmd‘
let cmd = ‘""‘ . $VIMRUNTIME . ‘\diff"‘
let eq = ‘"‘
else
let cmd = substitute($VIMRUNTIME, ‘ ‘, ‘" ‘, ‘‘) . ‘\diff"‘
endif
else皇冠圖片
let cmd = $VIMRUNTIME . ‘\diff‘
endifhttp://www.enterdesk.com/special/huangguantp/?
silent execute ‘!‘ . cmd . ‘ ‘ . opt . arg1 . ‘ ‘ . arg2 . ‘ > ‘ . arg3 . eq
endfunction
"================================
colorscheme darkblue2 " 色彩配置darkblue2
syntax enable " 開啟文法高亮
syntax on " 開啟檔案類型偵測
filetype indent on " 針對不同的檔案類型採用不同的縮排格式
filetype plugin on " 針對不同的檔案類型載入對應的外掛程式
filetype plugin indent on
set tabstop=4 " 設定tab鍵的寬度
set shiftwidth=4 " 換行時行間交錯使用4個空格
set autoindent " 自動對齊
set backspace=2 " 設定退格鍵可用
set cindent shiftwidth=4 " 自動縮排4空格
set smartindent " 智能自動縮排
set ai! " 設定自動縮排
set nu! " 顯示行號
set showmatch " 顯示括弧配對情況
set mouse=a " 啟用滑鼠
set ruler " 右下角顯示光線標位置的狀態行
set incsearch " 尋找book時,當輸入/b時會自動找到
set hlsearch " 開啟高亮顯示結果
set incsearch " 開啟即時搜尋功能
set nowrapscan " 搜尋到檔案兩端時不重新搜尋
set nocompatible " 關閉相容模式
set vb t_vb= " 關閉提示音
set cursorline " 反白當前行
set hidden " 允許在有未儲存的修改時切換緩衝區
set list
set listchars=tab:\|\ , " 顯示Tab符,使用一高亮豎線代替
"set listchars=tab:>-,trail:- " 顯示Tab符,使用" >-- "代替
if has("gui_running")
au GUIEnter * simalt ~x " 視窗啟動時自動最大化
"set guioptions-=m " 隱藏功能表列
"set guioptions-=T "隱藏工具列,注釋時啟用工具列,裡面有個儲存當前會話和載入會話挺有用,當然也可以用命令實現。
set guioptions-=L " 隱藏左側捲軸
set guioptions-=r " 隱藏右側捲軸
"set guioptions-=b " 隱藏底部捲軸
"set showtabline=0 " 隱藏Tab欄
endif
set writebackup " 設定無備份檔案
set nobackup
set autochdir " 設定檔案瀏覽器目錄為目前的目錄
"set nowrap " 設定不自動換行
set foldmethod=syntax " 選擇程式碼摺疊功能類型
set foldlevel=100 " 禁止自動摺疊
" For Haskell
:let hs_highlight_delimiters=1 " 高亮定界符
:let hs_highlight_boolean=1 " 把True和False識別為關鍵字
:let hs_highlight_types=1 " 把基本類型的名字識別為關鍵字
:let hs_highlight_more_types=1 " 把更多常用類型識別為關鍵字
:let hs_highlight_debug=1 " 高亮調試函數的名字
:let hs_allow_hash_operator=1 " 阻止把#高亮為錯誤
set laststatus=2 " 開啟狀態列資訊
set cmdheight=1 " 命令列的高度,預設為1,這裡可以重設
" 狀態行顯示的內容 [包括系統平台、檔案類型、座標、所佔比例、時間等]
set statusline=%f%m%r%h%w\ [format=%{&ff}]\ [type=%y]\ [pos=%l,%v][%p%%]\ %y%r%m%*%=\ %{strftime(\"%y/%m/%d\ -\ %h:%m\")}
gVIM+zencoding快速開發HTML/CSS/JS(適用WEB前端)