This is the original VIM plugin, and is bundled with Phpactor by default.
Prerequisites:
Using the vim-plug plugin
manager add the following in your VIM configuration (e.g. ~/.vimrc
or ~/.config/nvim/init.vim when using Neovim):
Plug 'phpactor/phpactor', {'for': 'php', 'tag': '*', 'do': 'composer install --no-dev -o'}
Reload VIM (or :source ~/.vimrc) then update your plugins:
:PlugInstall
If you need to install the dependencies manually, then:
$ cd ~/.vim/plugged/phpactor $ composer install
Now open a PHP file and issue the following command :PhpactorStatus:
Support ------- [✔] Composer detected - faster class location and more features! [✔] Git detected - enables faster refactorings in your repository scope! [✔] XDebug is disabled. XDebug has a negative effect on performance. Config files ------------ [✔] /home/daniel/www/phpactor/phpactor/.phpactor.yml [✔] /home/daniel/.config/phpactor/phpactor.yml [✘] /etc/xdg/phpactor/phpactor.yml
To find out more about the plugin type :help phpactor
You need to open a PHP file before using Phpactor.
If you run an older version of PHP by default, you will need to install
another version and set :phpactorPhpBin in your .vimrc (or equivalent):
let g:phpactorPhpBin = "/usr/bin/php7.3"The Git and Composer checks are referring to the current “workspace” (i.e. where you started Vim from). If you’ve already setup Git and Composer for your project, ensure you are starting Vim from the project directory to enable detection.
To find out how to use the plugin type :help phpactor or view the
:doc:`../vim-plugin/man`.
The following plugins add more functionality to Phpactor
- ncm2-phpactor: Integrates with the ncm2 autocompletion manager (for Neovim).
- deoplete-phpactor: Integrates with deoplete
- coc-phpactor: Integrates with CoC
- phpactor-mappings: Provides sensible default key mappings for Phpactor.