gVIM+zencoding快速开发HTML/CSS/JS(适用WEB前端)
生活随笔
收集整理的這篇文章主要介紹了
gVIM+zencoding快速开发HTML/CSS/JS(适用WEB前端)
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
一、真正解決了UTF-8中文亂碼的各種問(wèn)題(菜單亂碼,內(nèi)容亂碼,提示信息亂碼),不用擔(dān)心WIN用默認(rèn)編碼寫(xiě)的東西在Linux亂碼,或在Linux(zh_CN.UTF-8時(shí))寫(xiě)的東西在WIN下亂碼。在Arch、CentOS 6.2、win 7 SP1,使用GVIM 7.3.46測(cè)試通過(guò),無(wú)問(wèn)題。 二、添加了zenconding,配色方案包,JS,自動(dòng)補(bǔ)全插件,使前端開(kāi)發(fā)更快速。 三、使用時(shí)將vimfiles、_vimrc覆蓋至安裝目錄即可。 四、參考了論壇里一些網(wǎng)友的設(shè)置,并附上其教程,表示感謝。 五、VIM博大精深(對(duì)我來(lái)說(shuō)),如有疑惑,請(qǐng)參考附件手冊(cè)。僅此而已。?
附上一張圖?
?
?2. [代碼][其他]代碼 ?
set nocompatible
"source $VIMRUNTIME/vimrc_example.vim "軟件安裝默認(rèn),source入vimrc_example.vim后,在設(shè)置encoding=utf-8時(shí),將導(dǎo)致中文菜單亂碼難以解決
source $VIMRUNTIME/mswin.vim
behave mswin
?
" 字體、字號(hào)
set guifont=Courier\ New:h13
?
" 編碼設(shè)置
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 ? ? ? ? ? ? ? ? ? ? ? ? "設(shè)置文件格式為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 ? ? ? ? ? ? ? ?" 打開(kāi)語(yǔ)法高亮
syntax on ? ? ? ? ? ? ? ? ? ?" 開(kāi)啟文件類型偵測(cè)
filetype indent on ? ? ? ? ? " 針對(duì)不同的文件類型采用不同的縮進(jìn)格式
filetype plugin on ? ? ? ? ? " 針對(duì)不同的文件類型加載對(duì)應(yīng)的插件
filetype plugin indent on
set tabstop=4 ? ? ? ? ? ? ? ?" 設(shè)置tab鍵的寬度
set shiftwidth=4 ? ? ? ? ? ? " 換行時(shí)行間交錯(cuò)使用4個(gè)空格
set autoindent ? ? ? ? ? ? ? " 自動(dòng)對(duì)齊
set backspace=2 ? ? ? ? ? ? ?" 設(shè)置退格鍵可用
set cindent shiftwidth=4 ? ? " 自動(dòng)縮進(jìn)4空格
set smartindent ? ? ? ? ? ? ?" 智能自動(dòng)縮進(jìn)
set ai! ? ? ? ? ? ? ? ? ? ? ?" 設(shè)置自動(dòng)縮進(jìn)
set nu! ? ? ? ? ? ? ? ? ? ? ?" 顯示行號(hào)
set showmatch ? ? ? ? ? ? ? " 顯示括號(hào)配對(duì)情況
set mouse=a ? ? ? ? ? ? ? ? ?" 啟用鼠標(biāo)
set ruler ? ? ? ? ? ? ? ? ? ?" 右下角顯示光標(biāo)位置的狀態(tài)行
set incsearch ? ? ? ? ? ? ? ?" 查找book時(shí),當(dāng)輸入/b時(shí)會(huì)自動(dòng)找到
set hlsearch ? ? ? ? ? ? ? ? " 開(kāi)啟高亮顯示結(jié)果
set incsearch ? ? ? ? ? ? ? ?" 開(kāi)啟實(shí)時(shí)搜索功能
set nowrapscan ? ? ? ? ? ? ? " 搜索到文件兩端時(shí)不重新搜索
set nocompatible ? ? ? ? ? ? " 關(guān)閉兼容模式
set vb t_vb= ? ? ? ? ? ? ? ? " 關(guān)閉提示音
set cursorline ? ? ? ? ? ? ?" 突出顯示當(dāng)前行
set hidden ? ? ? ? ? ? ? ? ? " 允許在有未保存的修改時(shí)切換緩沖區(qū)
set list ? ? ? ? ? ? ? ? ? ??
set listchars=tab:\|\ , ? ? " 顯示Tab符,使用一高亮豎線代替
"set listchars=tab:>-,trail:- ? ?" 顯示Tab符,使用" >-- "代替
?
if has("gui_running")
? ? au GUIEnter * simalt ~x ?" 窗口啟動(dòng)時(shí)自動(dòng)最大化
? ? "set guioptions-=m ? ? ? " 隱藏菜單欄
? ? "set guioptions-=T ? ? ? "隱藏工具欄,注釋時(shí)啟用工具欄,里面有個(gè)保存當(dāng)前會(huì)話和加載會(huì)話挺有用,當(dāng)然也可以用命令實(shí)現(xiàn)。
? ? set guioptions-=L ? ? ? " 隱藏左側(cè)滾動(dòng)條
? ? set guioptions-=r ? ? ? " 隱藏右側(cè)滾動(dòng)條
? ? "set guioptions-=b ? ? ? " 隱藏底部滾動(dòng)條
? ? "set showtabline=0 ? ? ? " 隱藏Tab欄
endif
?
set writebackup ? ? ? ? ? ? ?" 設(shè)置無(wú)備份文件
set nobackup
set autochdir ? ? ? ? ? ? ? ?" 設(shè)定文件瀏覽器目錄為當(dāng)前目錄
"set nowrap ? ? ? ? ? ? ? ? ?" 設(shè)置不自動(dòng)換行
set foldmethod=syntax ? ? ? ?" 選擇代碼折疊類型
set foldlevel=100 ? ? ? ? ? ?" 禁止自動(dòng)折疊
?
?
" For Haskell
:let hs_highlight_delimiters=1 ? ? ? ? ? ?" 高亮定界符
:let hs_highlight_boolean=1 ? ? ? ? ? ? ? " 把True和False識(shí)別為關(guān)鍵字
:let hs_highlight_types=1 ? ? ? ? ? ? ? ? " 把基本類型的名字識(shí)別為關(guān)鍵字
:let hs_highlight_more_types=1 ? ? ? ? ? ?" 把更多常用類型識(shí)別為關(guān)鍵字
:let hs_highlight_debug=1 ? ? ? ? ? ? ? ? " 高亮調(diào)試函數(shù)的名字
:let hs_allow_hash_operator=1 ? ? ? ? ? ? " 阻止把#高亮為錯(cuò)誤
?
?
set laststatus=2 ? ? ? ? ? ? ? ? ? ? ? ? ?" 開(kāi)啟狀態(tài)欄信息
set cmdheight=1 ? ? ? ? ? ? ? ? ? ? ? ? ? " 命令行的高度,默認(rèn)為1,這里可以重設(shè)
?
" 狀態(tài)行顯示的內(nèi)容 [包括系統(tǒng)平臺(tái)、文件類型、坐標(biāo)、所占比例、時(shí)間等]
set statusline=%f%m%r%h%w\ [format=%{&ff}]\ [type=%y]\ [pos=%l,%v][%p%%]\ %y%r%m%*%=\ %{strftime(\"%y/%m/%d\ -\ %h:%m\")}
附上一張圖?
?
1.?[圖片]?VIM配置文件????
?2. [代碼][其他]代碼 ?
set nocompatible
"source $VIMRUNTIME/vimrc_example.vim "軟件安裝默認(rèn),source入vimrc_example.vim后,在設(shè)置encoding=utf-8時(shí),將導(dǎo)致中文菜單亂碼難以解決
source $VIMRUNTIME/mswin.vim
behave mswin
?
" 字體、字號(hào)
set guifont=Courier\ New:h13
?
" 編碼設(shè)置
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 ? ? ? ? ? ? ? ? ? ? ? ? "設(shè)置文件格式為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 ? ? ? ? ? ? ? ?" 打開(kāi)語(yǔ)法高亮
syntax on ? ? ? ? ? ? ? ? ? ?" 開(kāi)啟文件類型偵測(cè)
filetype indent on ? ? ? ? ? " 針對(duì)不同的文件類型采用不同的縮進(jìn)格式
filetype plugin on ? ? ? ? ? " 針對(duì)不同的文件類型加載對(duì)應(yīng)的插件
filetype plugin indent on
set tabstop=4 ? ? ? ? ? ? ? ?" 設(shè)置tab鍵的寬度
set shiftwidth=4 ? ? ? ? ? ? " 換行時(shí)行間交錯(cuò)使用4個(gè)空格
set autoindent ? ? ? ? ? ? ? " 自動(dòng)對(duì)齊
set backspace=2 ? ? ? ? ? ? ?" 設(shè)置退格鍵可用
set cindent shiftwidth=4 ? ? " 自動(dòng)縮進(jìn)4空格
set smartindent ? ? ? ? ? ? ?" 智能自動(dòng)縮進(jìn)
set ai! ? ? ? ? ? ? ? ? ? ? ?" 設(shè)置自動(dòng)縮進(jìn)
set nu! ? ? ? ? ? ? ? ? ? ? ?" 顯示行號(hào)
set showmatch ? ? ? ? ? ? ? " 顯示括號(hào)配對(duì)情況
set mouse=a ? ? ? ? ? ? ? ? ?" 啟用鼠標(biāo)
set ruler ? ? ? ? ? ? ? ? ? ?" 右下角顯示光標(biāo)位置的狀態(tài)行
set incsearch ? ? ? ? ? ? ? ?" 查找book時(shí),當(dāng)輸入/b時(shí)會(huì)自動(dòng)找到
set hlsearch ? ? ? ? ? ? ? ? " 開(kāi)啟高亮顯示結(jié)果
set incsearch ? ? ? ? ? ? ? ?" 開(kāi)啟實(shí)時(shí)搜索功能
set nowrapscan ? ? ? ? ? ? ? " 搜索到文件兩端時(shí)不重新搜索
set nocompatible ? ? ? ? ? ? " 關(guān)閉兼容模式
set vb t_vb= ? ? ? ? ? ? ? ? " 關(guān)閉提示音
set cursorline ? ? ? ? ? ? ?" 突出顯示當(dāng)前行
set hidden ? ? ? ? ? ? ? ? ? " 允許在有未保存的修改時(shí)切換緩沖區(qū)
set list ? ? ? ? ? ? ? ? ? ??
set listchars=tab:\|\ , ? ? " 顯示Tab符,使用一高亮豎線代替
"set listchars=tab:>-,trail:- ? ?" 顯示Tab符,使用" >-- "代替
?
if has("gui_running")
? ? au GUIEnter * simalt ~x ?" 窗口啟動(dòng)時(shí)自動(dòng)最大化
? ? "set guioptions-=m ? ? ? " 隱藏菜單欄
? ? "set guioptions-=T ? ? ? "隱藏工具欄,注釋時(shí)啟用工具欄,里面有個(gè)保存當(dāng)前會(huì)話和加載會(huì)話挺有用,當(dāng)然也可以用命令實(shí)現(xiàn)。
? ? set guioptions-=L ? ? ? " 隱藏左側(cè)滾動(dòng)條
? ? set guioptions-=r ? ? ? " 隱藏右側(cè)滾動(dòng)條
? ? "set guioptions-=b ? ? ? " 隱藏底部滾動(dòng)條
? ? "set showtabline=0 ? ? ? " 隱藏Tab欄
endif
?
set writebackup ? ? ? ? ? ? ?" 設(shè)置無(wú)備份文件
set nobackup
set autochdir ? ? ? ? ? ? ? ?" 設(shè)定文件瀏覽器目錄為當(dāng)前目錄
"set nowrap ? ? ? ? ? ? ? ? ?" 設(shè)置不自動(dòng)換行
set foldmethod=syntax ? ? ? ?" 選擇代碼折疊類型
set foldlevel=100 ? ? ? ? ? ?" 禁止自動(dòng)折疊
?
?
" For Haskell
:let hs_highlight_delimiters=1 ? ? ? ? ? ?" 高亮定界符
:let hs_highlight_boolean=1 ? ? ? ? ? ? ? " 把True和False識(shí)別為關(guān)鍵字
:let hs_highlight_types=1 ? ? ? ? ? ? ? ? " 把基本類型的名字識(shí)別為關(guān)鍵字
:let hs_highlight_more_types=1 ? ? ? ? ? ?" 把更多常用類型識(shí)別為關(guān)鍵字
:let hs_highlight_debug=1 ? ? ? ? ? ? ? ? " 高亮調(diào)試函數(shù)的名字
:let hs_allow_hash_operator=1 ? ? ? ? ? ? " 阻止把#高亮為錯(cuò)誤
?
?
set laststatus=2 ? ? ? ? ? ? ? ? ? ? ? ? ?" 開(kāi)啟狀態(tài)欄信息
set cmdheight=1 ? ? ? ? ? ? ? ? ? ? ? ? ? " 命令行的高度,默認(rèn)為1,這里可以重設(shè)
?
" 狀態(tài)行顯示的內(nèi)容 [包括系統(tǒng)平臺(tái)、文件類型、坐標(biāo)、所占比例、時(shí)間等]
set statusline=%f%m%r%h%w\ [format=%{&ff}]\ [type=%y]\ [pos=%l,%v][%p%%]\ %y%r%m%*%=\ %{strftime(\"%y/%m/%d\ -\ %h:%m\")}
轉(zhuǎn)載于:https://www.cnblogs.com/xkzy/p/3951695.html
總結(jié)
以上是生活随笔為你收集整理的gVIM+zencoding快速开发HTML/CSS/JS(适用WEB前端)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: log4j源码阅读(一)之Logger
- 下一篇: js获取最近几天的日期(转载)