feat: remove null-ls

This commit is contained in:
Adrien Waksberg 2024-04-16 11:49:51 +02:00
parent 455b831f34
commit a083ec624c
7 changed files with 27 additions and 59 deletions

View file

@ -1,6 +1,6 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" },
"LuaSnip": { "branch": "master", "commit": "1d67ba34e93f74eefffc92a15d148a1bc736190e" },
"NvChad": { "branch": "v2.5", "commit": "6833c60694a626615911e379d201dd723511546d" },
"base46": { "branch": "v2.5", "commit": "adb64a6ae70f8c61c5ab8892f07d29dafd4d47ad" },
"better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" },
@ -13,20 +13,20 @@
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
"friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" },
"git-conflict.nvim": { "branch": "main", "commit": "4c8e252b87d54d944c1e56bfb477f78b6fdaf661" },
"gitsigns.nvim": { "branch": "main", "commit": "1a50b94066def8591d5f65bd60a4233902e9def4" },
"gitsigns.nvim": { "branch": "main", "commit": "d96ef3bbff0bdbc3916a220f5c74a04c4db033f2" },
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
"lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" },
"lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
"nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" },
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
"nvim-lint": { "branch": "master", "commit": "4055dc856d5ac8f6b85748006fd8fa6457e086e8" },
"nvim-lspconfig": { "branch": "master", "commit": "9619e53d3f99f0ca4ea3b88f5d97fce703131820" },
"nvim-tree.lua": { "branch": "master", "commit": "81eb8d519233c105f30dc0a278607e62b20502fd" },
"nvim-treesitter": { "branch": "master", "commit": "11a3584b81c3249d2b6279305aee1c7ad273985a" },
"nvim-web-devicons": { "branch": "master", "commit": "20921d33c605ba24c8d0b76b379a54a9c83ba170" },
"nvim-web-devicons": { "branch": "master", "commit": "b3468391470034353f0e5110c70babb5c62967d3" },
"plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" },
"telescope.nvim": { "branch": "master", "commit": "d26b666b45e5dde23332e4bde1227677f2d92e31" },
"telescope.nvim": { "branch": "master", "commit": "d00d9df48c00d8682c14c2b5da78bda7ef06b939" },
"ui": { "branch": "v2.5", "commit": "e1af69426b3c4b55c88bd1c81790c1c73b30bfa8" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
}

View file

@ -3,7 +3,7 @@ local options = {
lua = { "stylua" },
bash = { "shfmt" },
sh = { "shfmt" },
md = { "mdformat" },
markdown = { "markdownlint" },
yaml = { "yamlfmt" },
},

View file

@ -1,4 +1,4 @@
local configs = require("nvchad.configs.lspconfig")
local configs = require "nvchad.configs.lspconfig"
local on_attach = configs.on_attach
local on_init = configs.on_init
@ -7,14 +7,12 @@ local capabilities = configs.capabilities
local lspconfig = require "lspconfig"
-- if you just want default config for the servers then put them in a table
local servers = { "html", "cssls", "tsserver", "clangd", "yamlls", "ansiblels", "bashls", "rls" }
local servers = { "html", "cssls", "tsserver", "yamlls", "ansiblels", "bashls", "rls" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
end
--
-- lspconfig.pyright.setup { blabla}

View file

@ -1,23 +0,0 @@
local present, null_ls = pcall(require, "null-ls")
if not present then
return
end
local formatting = null_ls.builtins.formatting
local lint = null_ls.builtins.diagnostics
local sources = {
formatting.prettier,
formatting.stylua,
lint.ansiblelint.with({
filetypes = { "yaml" },
}),
lint.shellcheck,
lint.yamllint,
}
null_ls.setup {
debug = true,
sources = sources,
}

View file

@ -0,0 +1,4 @@
require("lint").linters_by_ft = {
yaml = { "yamllint", "ansible_lint" },
markdown = { "markdownlint" },
}

View file

@ -14,20 +14,10 @@ return {
end,
},
{
"neovim/nvim-lspconfig",
dependencies = {
-- format & linting
{
"jose-elias-alvarez/null-ls.nvim",
config = function()
require "configs.null-ls"
end,
},
},
"mfussenegger/nvim-lint",
config = function()
require("nvchad.configs.lspconfig").defaults()
require "configs.lspconfig"
end, -- Override to setup mason-lspconfig
require "configs.nvim-lint"
end,
},
{
"max397574/better-escape.nvim",

View file

@ -6,16 +6,13 @@ return {
require "configs.conform"
end,
},
-- These are some examples, uncomment them if you want to see them work!
-- {
-- "neovim/nvim-lspconfig",
-- config = function()
-- require("nvchad.configs.lspconfig").defaults()
-- require "configs.lspconfig"
-- end,
-- },
--
{
"neovim/nvim-lspconfig",
config = function()
require("nvchad.configs.lspconfig").defaults()
require "configs.lspconfig"
end,
},
{
"williamboman/mason.nvim",
opts = {
@ -28,10 +25,12 @@ return {
"shfmt",
"shellcheck",
"ansible-language-server",
"ansible-lint",
"yaml-language-server",
"yamllint",
"yamlfmt",
"dockerfile-language-server",
"mdformat",
"markdownlint",
},
},
},