mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
chore(extras): Added extra for laravel blade
This commit is contained in:
parent
6a2289d338
commit
8f511c76b9
1 changed files with 64 additions and 0 deletions
64
lua/lazyvim/plugins/extras/lang/blade.lua
Normal file
64
lua/lazyvim/plugins/extras/lang/blade.lua
Normal file
|
|
@ -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" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue