diff --git a/lazy-lock.json b/lazy-lock.json index 8d8e0ef..e46d65d 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -14,6 +14,7 @@ "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "code_runner.nvim": { "branch": "main", "commit": "6c5bfe44a6c7523350cd706e6b3b8101166eed99" }, "codeium.nvim": { "branch": "main", "commit": "d3b88eb3aa1de6da33d325c196b8a41da2bcc825" }, + "conform.nvim": { "branch": "master", "commit": "60e6fbddbdf37d7790de07dc7420beefaf650e5e" }, "dracula.nvim": { "branch": "main", "commit": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c" }, "dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" }, "friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" }, @@ -58,7 +59,7 @@ "rainbow-delimiters.nvim": { "branch": "master", "commit": "12b1a1e095d968887a17ef791c2edb78d7595d46" }, "rest.nvim": { "branch": "main", "commit": "91badd46c60df6bd9800c809056af2d80d33da4c" }, "smart-splits.nvim": { "branch": "master", "commit": "66fda3a601a5b4c679656f15eb6ddd613c8d3216" }, - "telescope.nvim": { "branch": "master", "commit": "f2bfde705ac752c52544d5cfa8b0aee0a766c1ed" }, + "telescope.nvim": { "branch": "master", "commit": "58ec6eca1c3704d130d749843e16fbf6c8cdc57e" }, "tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "9be4af5b1bc1f26a11206ed7ce8bf44312e7941a" }, "toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" }, "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, diff --git a/lua/plugins/phpcfg.lua b/lua/plugins/phpcfg.lua index 5d8b3a2..bc46a45 100644 --- a/lua/plugins/phpcfg.lua +++ b/lua/plugins/phpcfg.lua @@ -111,11 +111,39 @@ if pcode.active_php_config then opts = function(_, opts) opts.linters_by_ft = opts.linters_by_ft or {} opts.linters_by_ft.php = { "phpcs" } + opts.linters_by_ft.blade = { "tlint" } end, config = function(_, opts) require("lint").linters_by_ft = opts.linters_by_ft end, }, + { + "stevearc/conform.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = function(_, opts) + local psave = pcode.format_on_save or 0 + opts.formatters_by_ft = opts.formatters_by_ft or {} + opts.formatters_by_ft.blade = { "blade-formatter" } + if psave == 1 then + opts.format_on_save = { + timeout_ms = pcode.format_timeout_ms or 500, + lsp_fallback = true, + } + end + return opts + end, + config = function(_, opts) + local conform = require("conform") + conform.setup(opts) + vim.keymap.set({ "n", "v" }, "lF", function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = pcode.format_timeout_ms or 500, + }) + end, { desc = "Format file or range (in visual mode)" }) + end, + }, { "adalessa/laravel.nvim", dependencies = { diff --git a/lua/plugins/themes/_globalvar.lua b/lua/plugins/themes/_globalvar.lua index e5ca88f..12fd4e6 100644 --- a/lua/plugins/themes/_globalvar.lua +++ b/lua/plugins/themes/_globalvar.lua @@ -61,7 +61,9 @@ if pcode.active_php_config then table.insert(pcode.treesitter_ensure_installed, ts) end table.insert(pcode.mason_ensure_installed, "intelephense") + table.insert(pcode.mason_ensure_installed, "stimulus_ls") table.insert(pcode.null_ls_ensure_installed, "phpcbf") + table.insert(pcode.null_ls_ensure_installed, "blade_formatter") table.insert(pcode.null_ls_ensure_installed, "phpcs") end -- run if golang config true diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 9a035ed..e84b2c1 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -2,6 +2,7 @@ return { { "nvim-treesitter/nvim-treesitter", dependencies = { + { "nvim-treesitter/nvim-treesitter-context" }, { "JoosepAlviste/nvim-ts-context-commentstring", lazy = true, diff --git a/lua/user/lsp/settings/stimulus_ls.lua b/lua/user/lsp/settings/stimulus_ls.lua new file mode 100644 index 0000000..bf53a0b --- /dev/null +++ b/lua/user/lsp/settings/stimulus_ls.lua @@ -0,0 +1,4 @@ +return { + root_dir = require("lspconfig.util").root_pattern("composer.json", ".git") or vim.loop.cwd() or vim.fn.getcwd(), + singe_file_support = true, +}