Neovim PhpTools - one step toward phpstorm **
phptools-faster.mp4
-- There will be new features, improvements and bugfixes at least few times a week. -- if you have feature request or want to contribute please do. thanks
:PhpMethod
ex: $router->resolve(); || generates undefined method in class:PhpClass
ex: new Router(); or class Router extends|implements Route || generates the undefined class, trait, interface, enums with with proper namespace also creates use statement for the current file:PhpScripts
runs composer scripts:PhpNamespace
generates namespace for the file:PhpGetSet
-- public array $routes =[]; generates getter setter or both on cursor:PhpRefactor
-- inline selected text to function/method -- more will be added:PhpArtisan
-- removed because felt like this should be plugin it self:PhpCreate
-- Create Class, Interface, Enum, or Trait in current file with namespace
{ -- lazy
'ccaglak/phptools.nvim',
keys = {
{ "<leader>lm", "<cmd>PhpMethod<cr>"},
{ "<leader>lc", "<cmd>PhpClass<cr>"},
{ "<leader>ls", "<cmd>PhpScripts<cr>"},
{ "<leader>ln", "<cmd>PhpNamespace<cr>"},
{ "<leader>lg", "<cmd>PhpGetSet<cr>"},
{ "<leader>lf", "<cmd>PhpCreate<cr>"},
},
dependencies = {
"nvim-lua/plenary.nvim"
},
config = function()
require('phptools').setup({
ui = false, -- if you have stevearc/dressing.nvim or something similar keep it false or else true
})
vim.keymap.set('v','<leader>lr',':PhpRefactor<cr>')
end
}
- pleanery.nvim
- nvim-treesitter (
:TSInstall php json
) - recommended stevearc/dressing.nvim but optional (read config)
- custom templates
- append to codeactions
- ability make method public/protected/private
- custom template per directory base :? in Controller directory, controller template is generated
- run tests (run all, filter, file, line)
- Let me know if you have any edge cases
- Laravel Goto Blade/Components larago.nvim.
- PHP Namespace Resolver namespace.nvim.
- by PHPStorm