.. _vim_plugin: VIM RPC Plugin ============== This is the original VIM plugin, and is bundled with Phpactor by default. .. note:: Using the RPC part of phpactor is deprecated. Most of it's features have been implemented as part of the LSP which should be used instead. Installation ------------ **Prerequisites**: - `Composer `__ - PHP 8.0 - `VIM 8 `__ or `Neovim `__ 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`` Troubleshooting ~~~~~~~~~~~~~~~ ``E492: Not an editor command: PhpactorStatus`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You need to open a PHP file before using Phpactor. ``Phpactor requires at least PHP 8.0`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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): .. code:: vim let g:phpactorPhpBin = "/usr/bin/php7.3" ``Composer not found** or **Git not detected`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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. Usage and Configuration ----------------------- To find out how to use the plugin type ``:help phpactor`` or view the :doc:`../vim-plugin/man`. Complementary Plugins --------------------- 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.