vim-php-cs-fixer is a vim plugin for integrate PHP Coding Standards Fixer in vim.
- vim or neovim
- php-cs-fixer.phar
- php
cd ~/.vim/bundle
git clone https://github.com/emmanuelgrognet/vim-phpcsfixer.git
Plug 'vim-phpcsfixer'
For example :
let g:php_cs_fixer_phar_path = 'c:\Program Files\php71\php-cs-fixer.phar'
To call the plugin define your key mapping.
nmap <silent> <Leader>pcs :call PHPCSFix()<CR>
let g:vim_php_cs_fixer_php_path = 'php'
let g:vim_php_cs_fixer_rules = '@PSR1,@PSR2'