mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-22 08:53:31 +02:00
add: cocnform ignore patern and nvimlint ignore patern
This commit is contained in:
parent
77ec605527
commit
5fe2180144
6 changed files with 25 additions and 7 deletions
|
@ -15,11 +15,11 @@
|
|||
"conform.nvim": { "branch": "master", "commit": "60e6fbddbdf37d7790de07dc7420beefaf650e5e" },
|
||||
"dracula.nvim": { "branch": "main", "commit": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "4288ce8128a52650e401dda42fd7651a6038f262" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "69041bccb70f68408633e93ed33012ee18889bb0" },
|
||||
"lsp-progress.nvim": { "branch": "main", "commit": "55a04895ea20c365b670051a3128265d43bdfa3d" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" },
|
||||
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
|
||||
|
@ -37,7 +37,7 @@
|
|||
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
|
||||
"nvim-scrollview": { "branch": "main", "commit": "fd334e5ad0c616987d1b9114890a59c97165cf83" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "2086e564c4d23fea714e8a6d63b881e551af2f41" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "09700b88b41ed96391de3d2010d74dc54fd5c210" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "53b32a6aa3e1de224e82f88cbdc08584c753adb7" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "5efba33af0f39942e426340da7bc15d7dec16474" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "ddfccbf0df1b9349c2b9e9b17f4afa8f9b6c1ed1" },
|
||||
|
|
|
@ -45,7 +45,7 @@ pcode.format_timeout_ms = 5000
|
|||
-- https://github.com/mfussenegger/nvim-lint
|
||||
-- https://github.com/stevearc/conform.nvim
|
||||
-- use conform and nvim-lint if set true
|
||||
pcode.disable_null_ls = false
|
||||
pcode.disable_null_ls = true
|
||||
|
||||
pcode.treesitter_ensure_installed = {}
|
||||
|
||||
|
|
|
@ -28,6 +28,10 @@ return {
|
|||
["xmlformatter"] = "xmlformat",
|
||||
}
|
||||
|
||||
local ignore = {
|
||||
["php"] = "tlint",
|
||||
}
|
||||
|
||||
for _, pkg in pairs(mason_reg.get_installed_packages()) do
|
||||
for _, type in pairs(pkg.spec.categories) do
|
||||
-- only act upon a formatter
|
||||
|
@ -62,6 +66,7 @@ return {
|
|||
if name_map[pkg.spec.name] ~= nil then
|
||||
pkg.spec.name = name_map[pkg.spec.name]
|
||||
end
|
||||
if ignore[ftl] ~= pkg.spec.name then
|
||||
formatters_by_ft[ftl] = formatters_by_ft[ftl] or {}
|
||||
table.insert(formatters_by_ft[ftl], pkg.spec.name)
|
||||
end
|
||||
|
@ -69,6 +74,7 @@ return {
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
format_on_save = {
|
||||
|
|
|
@ -64,6 +64,10 @@ return {
|
|||
["yamllint"] = "yamllint",
|
||||
}
|
||||
|
||||
local ignore = {
|
||||
["php"] = "tlint",
|
||||
}
|
||||
|
||||
for _, pkg in pairs(mason_reg.get_installed_packages()) do
|
||||
for _, type in pairs(pkg.spec.categories) do
|
||||
-- only act upon a formatter
|
||||
|
@ -79,6 +83,7 @@ return {
|
|||
if name_map[pkg.spec.name] ~= nil then
|
||||
pkg.spec.name = name_map[pkg.spec.name]
|
||||
end
|
||||
if ignore[ftl] ~= pkg.spec.name then
|
||||
opts.linters_by_ft[ftl] = opts.linters_by_ft[ftl] or {}
|
||||
table.insert(opts.linters_by_ft[ftl], pkg.spec.name)
|
||||
end
|
||||
|
@ -86,6 +91,7 @@ return {
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("lint").linters_by_ft = opts.linters_by_ft
|
||||
|
|
|
@ -131,6 +131,11 @@ M.on_attach = function(client, bufnr)
|
|||
end
|
||||
|
||||
local on_save = pcode.format_on_save or false
|
||||
-- disable if conform active
|
||||
local status, _ = pcall(require, "conform")
|
||||
if status then
|
||||
on_save = false
|
||||
end
|
||||
lsp_keymaps(bufnr, on_save)
|
||||
local status_ok, illuminate = pcall(require, "illuminate")
|
||||
if not status_ok then
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
return {
|
||||
filetypes = { "blade" },
|
||||
root_dir = require("lspconfig.util").root_pattern("composer.json", ".git") or vim.loop.cwd() or vim.fn.getcwd(),
|
||||
singe_file_support = true,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue