插件安裝組件php
https://github.com/tpope/vim-pathogenhtml
supertab自動補齊git
https://www.vim.org/scripts/script.php?script_id=1643github
auto pairs自動匹配括號vim
https://www.vim.org/scripts/script.php?script_id=3599spa
syncstatics 語法錯誤檢查插件
https://www.vim.org/scripts/script.php?script_id=2736code
html Emmet快速編寫神器htm
https://github.com/mattn/emmet-vimblog
Emmet 快速編寫教程
http://www.javashuo.com/article/p-ufwvbool-db.html
插件安裝方法,再安裝了pathogen下,只須要進入.vim/bunlder目錄下,git clone 插件就能夠直接用了
最後附上我的vimrc配置文件
execute pathogen#infect() filetype plugin indent on set nonu set tabstop=4 "tab鍵長度 set softtabstop=4 "刪除時長度 set shiftwidth=4 "自動tab長度 set expandtab "禁用tab 用空格代替 set cindent "C語言專用tab colorscheme darkblue "nnoremap i k "nnoremap k j "nnoremap j h "nnoremap h i "nnoremap H I nnoremap mm ) nnoremap mn ( nnoremap mh 0 nnoremap mk % nnoremap me $ inoremap <C-d> <del> nnoremap <C-c> <ESC>:w inoremap <C-b> <Left> inoremap <C-j> <Down> inoremap <C-k> <Up> inoremap <C-l> <Right> hi MatchParen ctermbg=blue ctermfg=white let g:user_emmet_leader_key='<C-Z>'
php實現自動縮進
mkdir ~/.vim/indent
vim ~/.vim/indent/php.vim #輸入下面的內容保存便可shengxiao
if exists("b:did_indent") finish endif if exists('s:doing_indent_inits') finish endif let s:doing_indent_inits = 1 runtime! indent/html.vim unlet b:did_indent runtime! indent/php.vim unlet s:doing_indent_inits function! GetPhpHtmlIndent(lnum) if exists('*HtmlIndent') let html_ind = HtmlIndent() else let html_ind = HtmlIndentGet(a:lnum) endif let php_ind = GetPhpIndet() if php_ind >-1 return php_ind endif if html_ind > -1 if getline(a:num) =~ "^<?" && (0< searchpair('<?', '', '?>', 'nWb') \ || 0 < searchpair('<?', '', '?>', 'nW')) return -1 endif return html_ind endif return -1 endfunction setlocal indentexpr=GetPhpHtmlIndent(v:lnum) setlocal indentkeys+=<>>