Added diagnostic configuration
This commit is contained in:
parent
b4fd286d0c
commit
f1298fb84e
1 changed files with 43 additions and 7 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
# Import all your configuration modules here
|
# Import all your configuration modules here
|
||||||
imports = [
|
imports = [
|
||||||
|
|
@ -32,14 +33,49 @@
|
||||||
globals = {
|
globals = {
|
||||||
mapleader = " ";
|
mapleader = " ";
|
||||||
};
|
};
|
||||||
diagnostic.settings = {
|
diagnostic.settings =
|
||||||
virtual_lines = {
|
let
|
||||||
current_line = true;
|
diagnostic = {
|
||||||
|
error = " ";
|
||||||
|
warning = " ";
|
||||||
|
hint = " ";
|
||||||
|
info = " ";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
virtual_lines = {
|
||||||
|
current_line = true;
|
||||||
|
};
|
||||||
|
virtual_text = {
|
||||||
|
source = "if_many";
|
||||||
|
prefix = lib.nixvim.mkRaw ''
|
||||||
|
function (diagnostic, index, total)
|
||||||
|
if diagnostic.severity == vim.diagnostic.severity.ERROR then
|
||||||
|
return "${diagnostic.error}"
|
||||||
|
end
|
||||||
|
if diagnostic.severity == vim.diagnostic.severity.WARN then
|
||||||
|
return "${diagnostic.warning}"
|
||||||
|
end
|
||||||
|
if diagnostic.severity == vim.diagnostic.severity.HINT then
|
||||||
|
return "${diagnostic.hint}"
|
||||||
|
end
|
||||||
|
if diagnostic.severity == vim.diagnostic.severity.INFO then
|
||||||
|
return "${diagnostic.info}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
update_in_insert = true;
|
||||||
|
severity_sort = true;
|
||||||
|
signs = {
|
||||||
|
text = lib.nixvim.utils.toRawKeys {
|
||||||
|
"vim.diagnostic.severity.ERROR" = diagnostic.error;
|
||||||
|
"vim.diagnostic.severity.WARN" = diagnostic.warning;
|
||||||
|
"vim.diagnostic.severity.HINT" = diagnostic.hint;
|
||||||
|
"vim.diagnostic.severity.INFO" = diagnostic.info;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
virtual_text = true;
|
|
||||||
update_in_insert = true;
|
|
||||||
severity_sort = true;
|
|
||||||
};
|
|
||||||
extraConfigLua = ''
|
extraConfigLua = ''
|
||||||
vim.keymap.set("n", "<leader>pb", ":Pick buffers<CR>", {desc = "Pick buffers"})
|
vim.keymap.set("n", "<leader>pb", ":Pick buffers<CR>", {desc = "Pick buffers"})
|
||||||
vim.keymap.set("n", "<leader>pd", ":Pick diagnostic<CR>", {desc = "Pick diagnostic"})
|
vim.keymap.set("n", "<leader>pd", ":Pick diagnostic<CR>", {desc = "Pick diagnostic"})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue