Files
lua-config-vim/lua/plugins/php-tools.lua

61 lines
3.0 KiB
Lua

return {
"ccaglak/phptools.nvim",
keys = {
{ "<leader>lm", "<cmd>PhpTools Method<cr>" },
{ "<leader>lc", "<cmd>PhpTools Class<cr>" },
{ "<leader>ls", "<cmd>PhpTools Scripts<cr>" },
{ "<leader>ln", "<cmd>PhpTools Namespace<cr>" },
{ "<leader>lg", "<cmd>PhpTools GetSet<cr>" },
{ "<leader>lf", "<cmd>PhpTools Create<cr>" },
{ "<leader>ld", "<cmd>PhpTools DrupalAutoLoader<cr>" },
{ mode = "v", "<leader>lr", "<cmd>PhpTools Refactor<cr>" },
},
dependencies = {
"ccaglak/namespace.nvim", -- optional - php namespace resolver
"ccaglak/larago.nvim", -- optional -- laravel goto blade/components
-- "ccaglak/snippets.nvim", -- optional -- native snippet expander
},
config = function()
require("phptools").setup({
ui = {
enable = true, -- default:true; false only if you have a UI enhancement plugin
fzf = false, -- default:false; requires fzf used only in tests module otherwise there might long list of tests
},
create = false, -- default:false autorun PhpTools Create when creating a new php file
drupal_autoloader = { -- delete if you dont use it
scan_paths = { "/web/modules/contrib/" }, -- Paths to scan for modules
root_markers = { ".git" }, -- Project root markers
autoload_file = "/vendor/composer/autoload_psr4.php", -- Autoload file path
},
custom_toggles = {
-- { "foo", "bar", "baz" }, -- Add more custom toggle groups here
},
})
local map = vim.keymap.set
-- local ide_helper = require("phptools.ide_helper")
-- -- Laravel IDE Helper keymaps
-- map("n", "<leader>lha", ide_helper.generate_all, { desc = "Generate all IDE helpers" })
-- map("n", "<leader>lhm", ide_helper.generate_models, { desc = "Generate model helpers" })
-- map("n", "<leader>lhf", ide_helper.generate_facades, { desc = "Generate facade helpers" })
-- map("n", "<leader>lht", ide_helper.generate_meta, { desc = "Generate meta helper" })
-- map("n", "<leader>lhi", ide_helper.install, { desc = "Install IDE Helper package" })
--
-- local tests = require("phptools.tests")
-- map("n", "<Leader>ta", tests.test.all, { desc = "Run all tests" })
-- map("n", "<Leader>tf", tests.test.file, { desc = "Run current file tests" })
-- map("n", "<Leader>tl", tests.test.line, { desc = "Run test at cursor" })
-- map("n", "<Leader>ts", tests.test.filter, { desc = "Search and run test" })
-- map("n", "<Leader>tp", tests.test.parallel, { desc = "Run tests in parallel" })
-- map("n", "<Leader>tr", tests.test.rerun, { desc = "Rerun last test" })
-- map("n", "<Leader>ti", tests.test.selected, { desc = "Run selected test file" })
--
-- local fn = require("phptools.fn")
-- map("n", "<leader>llf", fn.toggle_function, { desc = "Toggle PHP function style" })
-- map("n", "<leader>lli", fn.toggle_if_ternary, { desc = "Toggle if/ternary" })
-- map("n", "<leader>llm", fn.toggle_if_match, { desc = "Toggle if/match" })
-- map("n", "<leader>llm", fn.toggle_quotes, { desc = "Toggle qoutes" })
end,
}