VIM / NeoVim

Client Guides

  • Neovim 0.5.0 or higher.

  • nvim-lspconfig package (this contains common LSP configurations, including one for Phpactor)

  • phpactor is installed and executable in your path

For example: include it in your .vimrc with Plug:

Plug 'neovim/nvim-lspconfig'

Then enable it in your .vimrc. (note that on_attach is a callback which can be used for key bindings):

lua << EOF
    on_attach = on_attach,
    init_options = {
        ["language_server_phpstan.enabled"] = false,
        ["language_server_psalm.enabled"] = false,

the init_options map directly to Phpactors configuration.

Please refer to the nvim-lspconfig package for keybindings (also see :help lsp).

See NVIM LSP Configuration Snippets for further configuration options.


Two dollars on variables

This can happen because of the iskeyword setting in VIM.

You can try adding $ to the list of keywords to solve the problem:

autocmd FileType php set iskeyword+=$

or configure Phpactor to trim the $ prefix in .phpactor.json:

    "language_server_completion.trim_leading_dollar": true