I\'ve added some simple inoremap commands to my .vimrc to help with parens and brackets completion, but I only want them to apply to php files.
You need to do 2 things:
option for inoremap.This can be done via an autocommand in your .vimrc like so:
autocmd FileType php inoremap ( ()i
The other way option is by creating a filetype plugin. (see :h ftplugin for more details)
A simple example is do create a file named, ~/.vim/after/ftplugin/php.vim and place your mappings inside like so:
inoremap ( ()i
inoremap { {}ko
inoremap i
I personally lean more towards the ftplugin approach but having a everything in your .vimrc file can be nice.