This plugin for Vim enable an auto-close chars feature for you. For instance if you type an '(', ``autoclose`` will automatically insert a ')' and put the cursor between than.
autocmd BufNewFile,BufRead .test set syntax=php
autocmd BufNewFile,BufRead .inc set syntax=php
autocmd BufNewFile,BufRead .module set syntax=php
autocmd BufNewFile,BufRead .info set syntax=php
autocmd BufNewFile,BufRead .tpl.php set syntax=html.php
autocmd BufNewFile,Bufread .install set filetype=php
autocmd BufNewFile,BufRead .profile set filetype=php
autocmd BufNewFile,BufRead .view set filetype=php
let php_sql_query = 1
let php_baselib = 1
let php_htmlInStrings = 1
function! PhpSyntaxOverride()
hi! def link phpDocTags phpDefine
hi! def link phpDocParam phpType
endfunction
augroup phpSyntaxOverride
autocmd!
autocmd FileType php call PhpSyntaxOverride()
augroup END
.php extensions seem to work fine, but Drupal extensions don't display my syntax highlighting.
relevant parts from my .vimrc:
Plugin 'gmarik/Vundle.vim' Plugin 'fholgado/minibufexpl.vim' Plugin 'nathanaelkane/vim-indent-guides' Plugin 'bling/vim-airline' Plugin 'octol/vim-cpp-enhanced-highlight' Plugin 'shawncplus/phpcomplete.vim' Plugin 'majutsushi/tagbar' Plugin 'scrooloose/syntastic' Plugin 'ludovicchabant/vim-lawrencium' " Plugin 'jlfwong/vim-mercenary' Plugin 'tpope/vim-surround' Plugin 'wombat256.vim' Plugin 'paranoida/vim-airlineish.git' Plugin 'GertjanReynaert/cobalt2-vim-theme' Plugin 'gosukiwi/vim-atom-dark' Plugin 'tomasr/molokai' Plugin 'vim-scripts/desertEx' Plugin 'gilsondev/lizard' Plugin 'ajh17/Spacegray.vim'
syntax on filetype plugin on filetype indent on
autocmd BufNewFile,BufRead .test set syntax=php autocmd BufNewFile,BufRead .inc set syntax=php autocmd BufNewFile,BufRead .module set syntax=php autocmd BufNewFile,BufRead .info set syntax=php autocmd BufNewFile,BufRead .tpl.php set syntax=html.php autocmd BufNewFile,Bufread .install set filetype=php autocmd BufNewFile,BufRead .profile set filetype=php autocmd BufNewFile,BufRead .view set filetype=php
let php_sql_query = 1 let php_baselib = 1 let php_htmlInStrings = 1
function! PhpSyntaxOverride() hi! def link phpDocTags phpDefine hi! def link phpDocParam phpType endfunction
augroup phpSyntaxOverride autocmd! autocmd FileType php call PhpSyntaxOverride() augroup END