diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2022-07-24 20:46:17 +0200 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2022-07-24 20:46:35 +0200 |
| commit | cde37f523581cecfe8cd708f964f2d34934c6907 (patch) | |
| tree | 9a00b820274677763b56fb68c648647d10d0e295 /after/plugin | |
| parent | 4acd2329872ccc4a2c32b2777201461d254098b4 (diff) | |
| download | nvim-conf-cde37f523581cecfe8cd708f964f2d34934c6907.tar.gz nvim-conf-cde37f523581cecfe8cd708f964f2d34934c6907.zip | |
Update config to mason, lsp lines, remove old plugins
Diffstat (limited to 'after/plugin')
| -rw-r--r-- | after/plugin/lsp.lua | 24 | ||||
| -rw-r--r-- | after/plugin/lsp_lines.lua | 10 | ||||
| -rw-r--r-- | after/plugin/mason.lua | 20 | ||||
| -rw-r--r-- | after/plugin/null-ls.lua | 1 |
4 files changed, 45 insertions, 10 deletions
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 8b8d1b2..d025ad1 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -1,14 +1,18 @@ local telescope_mapper = require("alpha.telescope.mappings") -local filetype_attach = setmetatable({ - go = function(_) +local format_on_save = function(_) vim.cmd([[ augroup lsp_buf_format au! BufWritePre <buffer> - autocmd BufWritePre <buffer> :lua vim.lsp.buf.formatting_sync() + autocmd BufWritePre <buffer> :lua vim.lsp.buf.format({ async = true }) augroup END ]]) - end, + end + +local filetype_attach = setmetatable({ + go = format_on_save, + php = format_on_save, + lua = format_on_save, gdscript = function(_) end, }, { @@ -42,12 +46,12 @@ local function on_attach(client) filetype_attach[filetype](client) end -vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - underline = true, - update_in_insert = false, - virtual_text = { spacing = 2, prefix = "●" }, - severity_sort = true, -}) +-- vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { +-- underline = true, +-- update_in_insert = false, +-- virtual_text = { spacing = 2, prefix = "●" }, +-- severity_sort = true, +-- }) local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } for type, icon in pairs(signs) do diff --git a/after/plugin/lsp_lines.lua b/after/plugin/lsp_lines.lua new file mode 100644 index 0000000..0ac3df8 --- /dev/null +++ b/after/plugin/lsp_lines.lua @@ -0,0 +1,10 @@ +local ok, lsp_lines = pcall(require, "lsp_lines") +if not ok then + return +end + +vim.diagnostic.config({ + virtual_text = false, +}) + +lsp_lines.setup() diff --git a/after/plugin/mason.lua b/after/plugin/mason.lua new file mode 100644 index 0000000..d757d62 --- /dev/null +++ b/after/plugin/mason.lua @@ -0,0 +1,20 @@ +local ok, mason = pcall(require, "mason") +if not ok then + return +end + +local mason_lspconfig = require("mason-lspconfig") + +mason.setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + }, + }, +}) + +mason_lspconfig.setup({ + automatic_installation = true, +}) diff --git a/after/plugin/null-ls.lua b/after/plugin/null-ls.lua index 2c1cef4..626e2f3 100644 --- a/after/plugin/null-ls.lua +++ b/after/plugin/null-ls.lua @@ -11,6 +11,7 @@ local sources = { null_ls.builtins.diagnostics.eslint, null_ls.builtins.diagnostics.phpstan, null_ls.builtins.formatting.phpcsfixer, + null_ls.builtins.formatting.pint, null_ls.builtins.diagnostics.golangci_lint, -- null_ls.builtins.formatting.goimports, null_ls.builtins.formatting.jq, |