fix lots of nixvim warnings

This commit is contained in:
gwg313 2025-03-23 13:49:03 -04:00
parent 2446716e8f
commit fe4380c766
Signed by: gwg313
GPG key ID: 60FF63B4826B7400
20 changed files with 535 additions and 358 deletions

View file

@ -1,29 +1,32 @@
{...}: {
{ ... }:
{
programs.nixvim = {
plugins = {
clangd-extensions = {
enable = true;
enableOffsetEncodingWorkaround = true;
ast = {
roleIcons = {
type = "";
declaration = "";
expression = "";
specifier = "";
statement = "";
templateArgument = "";
};
kindIcons = {
compound = "";
recovery = "";
translationUnit = "";
packExpansion = "";
templateTypeParm = "";
templateTemplateParm = "";
templateParamObject = "";
settings = {
ast = {
role_icons = {
type = "";
declaration = "";
expression = "";
specifier = "";
statement = "";
templateArgument = "";
};
kind_icons = {
compound = "";
recovery = "";
translationUnit = "";
packExpansion = "";
templateTypeParm = "";
templateTemplateParm = "";
templateParamObject = "";
};
};
};
};
};
};

View file

@ -82,6 +82,143 @@
return { lsp_fallback = true }
end
'';
formattersByFt = {
bash = [
"shellcheck"
"shellharden"
"shfmt"
];
bicep = [ "bicep" ];
c = [ "clang_format" ];
cmake = [ "cmake-format" ];
cpp = [ "clang_format" ];
cs = [ "csharpier" ];
css = [ "stylelint" ];
fish = [ "fish_indent" ];
fsharp = [ "fantomas" ];
go = [ "gofmt" ];
haskell = [ "ormolu" ];
javascript = [
[
"prettierd"
"prettier"
]
];
json = [ "jq" ];
lua = [ "stylua" ];
markdown = [ "deno_fmt" ];
nix = [ "nixfmt" ];
python = [
"isort"
"black"
];
rust = [ "rustfmt" ];
sh = [
"shellcheck"
"shellharden"
"shfmt"
];
sql = [ "sqlfluff" ];
swift = [ "swift_format" ];
terraform = [ "terraform_fmt" ];
toml = [ "taplo" ];
typescript = [
[
"prettierd"
"prettier"
]
];
xml = [
"xmlformat"
"xmllint"
];
yaml = [ "yamlfmt" ];
zig = [ "zigfmt" ];
"_" = [
"squeeze_blanks"
"trim_whitespace"
"trim_newlines"
];
};
formatters = {
black = {
command = lib.getExe pkgs.black;
};
bicep = {
command = lib.getExe pkgs.bicep;
};
cmake-format = {
command = lib.getExe pkgs.cmake-format;
};
csharpier = {
command = lib.getExe pkgs.csharpier;
};
deno_fmt = {
command = lib.getExe pkgs.deno;
};
isort = {
command = lib.getExe pkgs.isort;
};
fantomas = {
command = lib.getExe pkgs.fantomas;
};
ormolu = {
command = lib.getExe pkgs.ormolu;
};
jq = {
command = lib.getExe pkgs.jq;
};
nixfmt = {
command = lib.getExe pkgs.nixfmt-rfc-style;
};
prettierd = {
command = lib.getExe pkgs.prettierd;
};
rustfmt = {
command = lib.getExe pkgs.rustfmt;
};
shellcheck = {
command = lib.getExe pkgs.shellcheck;
};
shfmt = {
command = lib.getExe pkgs.shfmt;
};
shellharden = {
command = lib.getExe pkgs.shellharden;
};
sqlfluff = {
command = lib.getExe pkgs.sqlfluff;
};
squeeze_blanks = {
comamnd = lib.getExe' pkgs.coreutils "cat";
};
stylelint = {
command = lib.getExe pkgs.stylelint;
};
stylua = {
command = lib.getExe pkgs.stylua;
};
swift_format = {
command = lib.getExe pkgs.swift-format;
};
taplo = {
command = lib.getExe pkgs.taplo;
};
terraform_fmt = {
command = lib.getExe pkgs.terraform;
};
xmlformat = {
command = lib.getExe pkgs.xmlformat;
};
yamlfmt = {
command = lib.getExe pkgs.yamlfmt;
};
zigfmt = {
command = lib.getExe pkgs.zig;
};
};
};
# NOTE:
@ -92,142 +229,7 @@
# Use the "*" filetype to run formatters on all filetypes.
# Use the "_" filetype to run formatters on filetypes that don't
# have other formatters configured.
formattersByFt = {
bash = [
"shellcheck"
"shellharden"
"shfmt"
];
bicep = [ "bicep" ];
c = [ "clang_format" ];
cmake = [ "cmake-format" ];
cpp = [ "clang_format" ];
cs = [ "csharpier" ];
css = [ "stylelint" ];
fish = [ "fish_indent" ];
fsharp = [ "fantomas" ];
go = [ "gofmt" ];
haskell = [ "ormolu" ];
javascript = [
[
"prettierd"
"prettier"
]
];
json = [ "jq" ];
lua = [ "stylua" ];
markdown = [ "deno_fmt" ];
nix = [ "nixfmt" ];
python = [
"isort"
"black"
];
rust = [ "rustfmt" ];
sh = [
"shellcheck"
"shellharden"
"shfmt"
];
sql = [ "sqlfluff" ];
swift = [ "swift_format" ];
terraform = [ "terraform_fmt" ];
toml = [ "taplo" ];
typescript = [
[
"prettierd"
"prettier"
]
];
xml = [
"xmlformat"
"xmllint"
];
yaml = [ "yamlfmt" ];
zig = [ "zigfmt" ];
"_" = [
"squeeze_blanks"
"trim_whitespace"
"trim_newlines"
];
};
formatters = {
black = {
command = lib.getExe pkgs.black;
};
bicep = {
command = lib.getExe pkgs.bicep;
};
cmake-format = {
command = lib.getExe pkgs.cmake-format;
};
csharpier = {
command = lib.getExe pkgs.csharpier;
};
deno_fmt = {
command = lib.getExe pkgs.deno;
};
isort = {
command = lib.getExe pkgs.isort;
};
fantomas = {
command = lib.getExe pkgs.fantomas;
};
ormolu = {
command = lib.getExe pkgs.ormolu;
};
jq = {
command = lib.getExe pkgs.jq;
};
nixfmt = {
command = lib.getExe pkgs.nixfmt-rfc-style;
};
prettierd = {
command = lib.getExe pkgs.prettierd;
};
rustfmt = {
command = lib.getExe pkgs.rustfmt;
};
shellcheck = {
command = lib.getExe pkgs.shellcheck;
};
shfmt = {
command = lib.getExe pkgs.shfmt;
};
shellharden = {
command = lib.getExe pkgs.shellharden;
};
sqlfluff = {
command = lib.getExe pkgs.sqlfluff;
};
squeeze_blanks = {
comamnd = lib.getExe' pkgs.coreutils "cat";
};
stylelint = {
command = lib.getExe pkgs.stylelint;
};
stylua = {
command = lib.getExe pkgs.stylua;
};
swift_format = {
command = lib.getExe pkgs.swift-format;
};
taplo = {
command = lib.getExe pkgs.taplo;
};
terraform_fmt = {
command = lib.getExe pkgs.terraform;
};
xmlformat = {
command = lib.getExe pkgs.xmlformat;
};
yamlfmt = {
command = lib.getExe pkgs.yamlfmt;
};
zigfmt = {
command = lib.getExe pkgs.zig;
};
};
};
};
};

View file

@ -36,7 +36,8 @@ _: {
./noice.nix
./notify.nix
./precognition.nix
./spectre.nix
# ./spectre.nix
./grug-far.nix
./snacks.nix
./refactoring.nix
./render-markdown.nix

View file

@ -0,0 +1,25 @@
{ ... }:
{
programs.nixvim = {
plugins = {
grug-far = {
enable = true;
settings = {
cmd = "GrugFar";
};
};
};
keymaps = [
{
mode = "n";
key = "<leader>rs";
action = "<cmd>GrugFar<CR>";
options = {
desc = "GrugFar toggle";
silent = true;
};
}
];
};
}

View file

@ -1,9 +1,12 @@
{...}: {
{ ... }:
{
programs.nixvim = {
plugins.lean = {
enable = true;
lsp.enable = false;
abbreviations.enable = false;
settings = {
abbreviations.enable = false;
lsp.enable = false;
};
};
};
}

View file

@ -62,7 +62,7 @@
};
};
servers = {
nil-ls = {
nil_ls = {
enable = true;
filetypes = [ "nix" ];
settings = {

View file

@ -1,8 +1,11 @@
{...}: {
{ ... }:
{
programs.nixvim = {
plugins.navic = {
enable = true;
lsp.autoAttach = true;
settings = {
lsp.autoAttach = true;
};
};
};
}

View file

@ -5,136 +5,140 @@
enable = true;
# Hides the title above noice boxes
cmdline = {
format = {
cmdline = {
pattern = "^:";
icon = "";
lang = "vim";
opts = {
border = {
text = {
top = "Cmd";
};
};
};
};
search_down = {
kind = "search";
pattern = "^/";
icon = " ";
lang = "regex";
};
search_up = {
kind = "search";
pattern = "^%?";
icon = " ";
lang = "regex";
};
filter = {
pattern = "^:%s*!";
icon = "";
lang = "bash";
opts = {
border = {
text = {
top = "Bash";
};
};
};
};
lua = {
pattern = "^:%s*lua%s+";
icon = "";
lang = "lua";
};
help = {
pattern = "^:%s*he?l?p?%s+";
icon = "󰋖";
};
input = { };
};
};
messages = {
view = "mini";
viewError = "mini";
viewWarn = "mini";
};
lsp = {
override = {
"vim.lsp.util.convert_input_to_markdown_lines" = true;
"vim.lsp.util.stylize_markdown" = true;
"cmp.entry.get_documentation" = true;
};
progress.enabled = true;
signature.enabled = true;
};
popupmenu.backend = "nui";
# Doesn't support the standard cmdline completions
# popupmenu.backend = "cmp";
presets = {
bottom_search = false;
command_palette = true;
long_message_to_split = true;
inc_rename = true;
lsp_doc_border = true;
};
settings = {
popupmenu.backend = "nui";
routes = [
{
filter = {
event = "msg_show";
kind = "search_count";
};
opts = {
skip = true;
};
}
{
# skip progress messages from noisy servers
filter = {
event = "lsp";
kind = "progress";
cond.__raw = ''
function(message)
local client = vim.tbl_get(message.opts, 'progress', 'client')
local servers = { 'jdtls' }
routes = [
{
filter = {
event = "msg_show";
kind = "search_count";
};
opts = {
skip = true;
};
}
{
# skip progress messages from noisy servers
filter = {
event = "lsp";
kind = "progress";
cond.__raw = ''
function(message)
local client = vim.tbl_get(message.opts, 'progress', 'client')
local servers = { 'jdtls' }
for index, value in ipairs(servers) do
if value == client then
return true
for index, value in ipairs(servers) do
if value == client then
return true
end
end
end
end
'';
};
opts = {
skip = true;
};
}
];
'';
};
opts = {
skip = true;
};
}
];
views = {
cmdline_popup = {
border = {
style = "single";
views = {
cmdline_popup = {
border = {
style = "single";
};
};
};
confirm = {
border = {
style = "single";
text = {
top = "";
confirm = {
border = {
style = "single";
text = {
top = "";
};
};
};
};
presets = {
bottom_search = false;
command_palette = true;
long_message_to_split = true;
inc_rename = true;
lsp_doc_border = true;
};
lsp = {
override = {
"vim.lsp.util.convert_input_to_markdown_lines" = true;
"vim.lsp.util.stylize_markdown" = true;
"cmp.entry.get_documentation" = true;
};
progress.enabled = true;
signature.enabled = true;
};
messages = {
view = "mini";
viewError = "mini";
viewWarn = "mini";
};
cmdline = {
format = {
cmdline = {
pattern = "^:";
icon = "";
lang = "vim";
opts = {
border = {
text = {
top = "Cmd";
};
};
};
};
search_down = {
kind = "search";
pattern = "^/";
icon = " ";
lang = "regex";
};
search_up = {
kind = "search";
pattern = "^%?";
icon = " ";
lang = "regex";
};
filter = {
pattern = "^:%s*!";
icon = "";
lang = "bash";
opts = {
border = {
text = {
top = "Bash";
};
};
};
};
lua = {
pattern = "^:%s*lua%s+";
icon = "";
lang = "lua";
};
help = {
pattern = "^:%s*he?l?p?%s+";
icon = "󰋖";
};
input = { };
};
};
};
};
};
}

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
programs.nixvim = {
plugins.todo-comments = {
enable = true;
@ -9,54 +10,56 @@
keywords = "TODO,FIX,HACK";
};
};
keywords = {
FIX = {
alt = [
"FIXME"
"BUG"
"FIXIT"
"ISSUE"
];
color = "error";
icon = " ";
};
HACK = {
color = "warning";
icon = " ";
};
NOTE = {
alt = ["INFO"];
color = "hint";
icon = " ";
};
PERF = {
alt = [
"OPTIM"
"PERFORMANCE"
"OPTIMIZE"
];
icon = " ";
};
TEST = {
alt = [
"TESTING"
"PASSED"
"FAILED"
];
color = "test";
icon = " ";
};
TODO = {
color = "info";
icon = " ";
};
WARN = {
alt = [
"WARNING"
"XXX"
];
color = "warning";
icon = " ";
settings = {
keywords = {
FIX = {
alt = [
"FIXME"
"BUG"
"FIXIT"
"ISSUE"
];
color = "error";
icon = " ";
};
HACK = {
color = "warning";
icon = " ";
};
NOTE = {
alt = [ "INFO" ];
color = "hint";
icon = " ";
};
PERF = {
alt = [
"OPTIM"
"PERFORMANCE"
"OPTIMIZE"
];
icon = " ";
};
TEST = {
alt = [
"TESTING"
"PASSED"
"FAILED"
];
color = "test";
icon = " ";
};
TODO = {
color = "info";
icon = " ";
};
WARN = {
alt = [
"WARNING"
"XXX"
];
color = "warning";
icon = " ";
};
};
};
};