diff --git a/lua/lazyvim/plugins/extras/lang/blade.lua b/lua/lazyvim/plugins/extras/lang/blade.lua new file mode 100644 index 00000000..388f096b --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/blade.lua @@ -0,0 +1,64 @@ +-- require("lazyvim.plugins").extras.lang.blade.setup({ +-- -- Your existing configuration +-- recommended = false, -- Add or ensure this line is present +-- }) + +return { + recommended = { + ft = "blade", + root = { "composer.json", "artisan" }, + }, + { + "nvim-tressiter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "blade", "php" }) + end + + local parser_config = require("nvim-treesitter.parsers").get_parser_configs() + parser_config.blade = { + install_info = { + url = "https://github.com/EmranMR/tree-sitter-blade", + files = { "src/parser.c" }, + branch = "main", + }, + filetype = "blade", + } + + vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, { + pattern = { "*.blade.php" }, + callback = function() + vim.treesitter.start(nil, "blade") + vim.opt.filetype = "blade" + end, + }) + end, + }, + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "tlint", + "blade-formatter", + }, + }, + }, + { + "mfussenegger/nvim-lint", + optional = true, + opts = { + linters_by_ft = { + blade = { "tlint" }, + }, + }, + }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + blade = { "blade-formatter" }, + }, + }, + }, +}