Get Started with Vimfony
Install the binary and configure Neovim in minutes.
1
Install the Binary
Download the binary for your OS and CPU architecture from the releases page. Once downloaded, move the vimfony binary to a directory in your $PATH.
mv vimfony ~/.local/bin/
Notice: Make sure ~/.local/bin is in your $PATH.
2
Configure Neovim
Add the following configuration to your Neovim setup (e.g., in init.lua or a separate LSP config file).
local git_root = vim.fs.root(0, ".git")
if git_root ~= nil then
vim.lsp.config('vimfony', {
cmd = { "vimfony" },
filetypes = { "php", "twig", "yaml", "xml" },
root_markers = { ".git" },
single_file_support = true,
init_options = {
roots = { "templates" },
container_xml_path = (git_root .. "/var/cache/dev/App_KernelDevDebugContainer.xml"),
-- OR:
-- container_xml_path = {
-- (git_root .. "/var/cache/dev/App_KernelDevDebugContainer.xml"),
-- (git_root .. "/var/cache/website/dev/App_KernelDevDebugContainer.xml"),
-- (git_root .. "/var/cache/admin/dev/App_KernelDevDebugContainer.xml"),
-- },
vendor_dir = git_root .. "/vendor",
-- Optional:
-- php_path = "/usr/bin/php",
},
})
vim.lsp.enable('vimfony')
end
Pro Tip: I highly recommend using Intelephense alongside Vimfony for the best PHP experience.
3
You're done.
Were you expecting a long and complex installation process? Don't worry. You're done. Promise.