Most of your Vim set-up will just work on Neovim if you follow the steps provided by Vivian, so whatever setup you already have to handle commenting, folds, and fussy finding should just work. You can port it to Lua one step at a time by following :h lua-guide
.
I'll just address the PHP part, which seems to be the core of your question. First, if you use a feature-complete language server, you don't need to deal with tags at all.
The quickest minimal way to try LSP, assuming you have a server already installed, is to create the file ~/.config/nvim/after/ftplugin/php.lua
with the following content:
vim.lsp.start({
cmd = {"<language-server-executable-name>"}, -- Update this
filetypes = {"php"},
root_dir = function(pattern)
local cwd = vim.loop.cwd()
local root = util.root_pattern('composer.json', '.git')(pattern)
return util.path.is_descendant(cwd, root) and cwd or root
end
})
This will start up the server when you create or read a PHP file, and by default completion should just work, as well as Ctrl-]
to go to definition. Unless you have customized these, in that case you need to review your current settings.
To create more mappings, or any customization, you can use any of the LSP events, see :h lsp-events
, or even just :h lsp
to get all the details. You can also try the LspAttach
function shown on lsp-config's README
, it will work with and without that plug-in.
Of course, if you don't want to set up every LSP you need manually, installing lsp-config
instead of defining every server per file type is the way to go