parent
8b85cf7c9e
commit
dc0260c20c
6 changed files with 1461 additions and 15 deletions
|
|
@ -11,7 +11,7 @@ return {
|
|||
-- Use a stop_after_first = true to run only the first available formatter
|
||||
-- Use the "_" filetype to run formatters on filetypes that don't
|
||||
-- have other formatters configured.
|
||||
["_"] = { "trim_whitespace", "injected" },
|
||||
["_"] = { "trim_whitespace" },
|
||||
blade = { "blade-formatter" },
|
||||
css = { "prettierd", "prettier" },
|
||||
go = { "gofumpt", "goimports_reviser", "golines" },
|
||||
|
|
@ -24,7 +24,7 @@ return {
|
|||
markdown = { "markdownlint" },
|
||||
nim = { "nimpretty" },
|
||||
php = { "pint" },
|
||||
python = { "blue" },
|
||||
python = { "ruff_format", "ruff_organize_imports" },
|
||||
scss = { "prettierd", "prettier", stop_after_first = true },
|
||||
sh = { "shfmt" },
|
||||
typescript = { "prettierd", "prettier", stop_after_first = true },
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return {
|
|||
javascriptreact = { "eslint_d" },
|
||||
typescriptreact = { "eslint_d" },
|
||||
-- astro = { "eslint_d" },
|
||||
python = { "pylint" },
|
||||
python = { "ruff" },
|
||||
sh = { "shellcheck" },
|
||||
NeogitCommitMessage = { "gitlint" },
|
||||
gitcommit = { "gitlint" },
|
||||
|
|
|
|||
|
|
@ -42,6 +42,11 @@ return {
|
|||
|
||||
nmap("<leader>lj", vim.diagnostic.goto_next, "Go to next diagnostic")
|
||||
nmap("<leader>lk", vim.diagnostic.goto_prev, "Go to prev diagnostic")
|
||||
nmap("<leader>lK", function()
|
||||
-- execute twice to enter the float inmediatly
|
||||
vim.diagnostic.open_float()
|
||||
vim.diagnostic.open_float()
|
||||
end, "Hover current diagnostic")
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
|
||||
|
|
@ -91,6 +96,7 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
ruff = {},
|
||||
rust_analyzer = {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
|
|
@ -178,18 +184,23 @@ return {
|
|||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
virtual_text = false,
|
||||
-- virtual_text = {
|
||||
-- spacing = 1,
|
||||
-- source = "if_many",
|
||||
-- prefix = " ●",
|
||||
-- suffix = " ",
|
||||
-- -- this will set set the prefix to a function that returns the diagnostics icon based on the severity
|
||||
-- -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported
|
||||
-- -- prefix = "icons",
|
||||
-- },
|
||||
underline = true,
|
||||
float = {
|
||||
source = true
|
||||
},
|
||||
virtual_text = {
|
||||
severity = vim.diagnostic.severity.ERROR,
|
||||
source = true,
|
||||
spacing = -1,
|
||||
prefix = nil,
|
||||
format = function(diagnostic)
|
||||
-- show small error code instead of whole error that probably won't fit in the screen
|
||||
-- to see the whole error use other keybindings
|
||||
return tostring(diagnostic.code)
|
||||
end,
|
||||
virt_text_hide = true
|
||||
},
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ return {
|
|||
opts = {
|
||||
ensure_installed = {
|
||||
"blue",
|
||||
"pylint",
|
||||
"ruff",
|
||||
"eslint_d",
|
||||
"markdownlint",
|
||||
"nimlsp",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue