all repos

init.lua @ 0908e01

my nvim config

init.lua/lua/plugins/lsp/null-ls.lua(view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---@type LazySpec
return {
  "nvimtools/none-ls.nvim",
  dependencies = { "nvim-lspconfig" },
  config = function()
    local null_ls = require "null-ls"
    local formatting = null_ls.builtins.formatting
    local diagnostic = null_ls.builtins.diagnostics

    null_ls.setup {
      sources = {
        diagnostic.codespell.with {
          args = {
            "--ignore-words",
            vim.fn.expand "$HOME" .. "/.config/codespell-ignore.txt",
            "-",
          },
        },

        formatting.stylua,
        diagnostic.selene.with {
          condition = function(utils)
            return utils.root_has_file "selene.toml"
          end,
        },

        formatting.goimports,
        formatting.golines,

        formatting.clang_format,
        formatting.pg_format,
        formatting.prettierd.with {
          -- stylua: ignore
          filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "html", "json", "jsonc", "svelte", "astro" },
        },
      },
    }
  end,
}