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.
 inoremap ( ()<Esc>i
 inoremap { {<CR>}<Esc>ko
 inoremap <? <?php ?><Esc><Left>i
How to I set these commands to be active only when I'm editing a .php file?
There may be a better way to do it, but this should work:
autocmd FileType php call Inoremaps()
fu! Inoremaps()
   inoremap ...
endfu
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With