config
This commit is contained in:
parent
98ac60227e
commit
90375de069
4
init.lua
4
init.lua
|
@ -559,7 +559,9 @@ local servers = {
|
|||
-- pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
tsserver = {},
|
||||
html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||
graphql = {},
|
||||
tailwindcss = {},
|
||||
html = { filetypes = { 'html', 'twig', 'hbs' } },
|
||||
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
|
|
|
@ -4,23 +4,20 @@
|
|||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"copilot.vim": { "branch": "release", "commit": "79e1a892ca9b4fa6234fd25f2930dba5201700bd" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "4e854f3299e21d1c18279add340428a97520fc44" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "dbd45e9ba76d535e4cba88afa1b7aa43bb765336" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
|
||||
"gopher.nvim": { "branch": "main", "commit": "ac27f4b6794c872140fb205313d79ab166892fe9" },
|
||||
"harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "fe4cce44dec93c69be17dad79b21de867dde118a" },
|
||||
"mason-null-ls.nvim": { "branch": "main", "commit": "bfaa24b899233385c92364f95856e6280bddef30" },
|
||||
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "bbe17de89345ce40725e721d347c596dc4a02b32" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "4715e3e0480152dbbca1a3b5d09f070508a54691" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "90f824d37c0cb079d2764927e73af77faa9ba0ef" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
|
||||
"nvim-dap": { "branch": "master", "commit": "fc880e82059eb21c0fa896be60146e5f17680648" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "605911fa0899882b05a8e4369ab12739620494af" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "d1bab4cf4b69e49d6058028fd933d8ef5e74e680" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "d35a8d5ec6358ada4b058431b367b32360737466" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "3a7b5a9fb46c261b83eadb126463a6e7bdfc8c78" },
|
||||
|
|
|
@ -4,7 +4,7 @@ return {
|
|||
event = "InsertEnter",
|
||||
opts = {}
|
||||
},
|
||||
{ 'github/copilot.vim' },
|
||||
-- { 'github/copilot.vim' },
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
config = function()
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
return {
|
||||
"nvimtools/none-ls.nvim", -- configure formatters & linters
|
||||
lazy = true,
|
||||
event = { "BufReadPre", "BufNewFile" }, -- to enable uncomment this
|
||||
dependencies = {
|
||||
"jay-babu/mason-null-ls.nvim",
|
||||
},
|
||||
config = function()
|
||||
local mason_null_ls = require("mason-null-ls")
|
||||
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
local null_ls_utils = require("null-ls.utils")
|
||||
|
||||
mason_null_ls.setup({
|
||||
ensure_installed = {
|
||||
"prettier", -- prettier formatter
|
||||
"stylua", -- lua formatter
|
||||
"eslint-lsp", -- js linter
|
||||
"golangci-lint",
|
||||
"gofumpt",
|
||||
"goimports",
|
||||
"goimports-reviser",
|
||||
"golines",
|
||||
"gomodifytags",
|
||||
"jsonls"
|
||||
},
|
||||
})
|
||||
|
||||
-- for conciseness
|
||||
local formatting = null_ls.builtins.formatting -- to setup formatters
|
||||
local diagnostics = null_ls.builtins.diagnostics -- to setup linters
|
||||
|
||||
-- to setup format on save
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
|
||||
-- configure null_ls
|
||||
null_ls.setup({
|
||||
-- add package.json as identifier for root (for typescript monorepos)
|
||||
root_dir = null_ls_utils.root_pattern(".null-ls-root", "Makefile", ".git", "package.json"),
|
||||
-- setup formatters & linters
|
||||
sources = {
|
||||
-- to disable file types use
|
||||
-- "formatting.prettier.with({disabled_filetypes: {}})" (see null-ls docs)
|
||||
formatting.prettier.with({
|
||||
extra_filetypes = { "svelte" },
|
||||
}), -- js/ts formatter
|
||||
formatting.stylua, -- lua formatter
|
||||
formatting.isort,
|
||||
formatting.black,
|
||||
diagnostics.pylint,
|
||||
diagnostics.eslint_d.with({ -- js/ts linter
|
||||
condition = function(utils)
|
||||
return utils.root_has_file({ ".eslintrc.js", ".eslintrc.cjs" }) -- only enable if root has .eslintrc.js or .eslintrc.cjs
|
||||
end,
|
||||
}),
|
||||
},
|
||||
-- configure format on save
|
||||
on_attach = function(current_client, bufnr)
|
||||
if current_client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({
|
||||
filter = function(client)
|
||||
-- only use null-ls for formatting instead of lsp server
|
||||
return client.name == "null-ls"
|
||||
end,
|
||||
bufnr = bufnr,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
Loading…
Reference in New Issue