feat: small improvements (#25)

- Renamed and moved settings in some plugins due to upstream changes
- Added comments to neovim settings
- Added cmdheight = 0 and mouse = "a" settings to config
This commit is contained in:
Roel de Cort 2024-08-26 23:37:02 +02:00 committed by GitHub
parent 01025e42f3
commit 502d31e03c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 275 additions and 159 deletions

View file

@ -1,12 +1,14 @@
_: {
plugins.todo-comments = {
enable = true;
colors = {
error = ["DiagnosticError" "ErrorMsg" "#ED8796"];
warning = ["DiagnosticWarn" "WarningMsg" "#EED49F"];
info = ["DiagnosticInfo" "#EED49F"];
default = ["Identifier" "#F5A97F"];
test = ["Identifier" "#8AADF4"];
settings = {
colors = {
error = ["DiagnosticError" "ErrorMsg" "#ED8796"];
warning = ["DiagnosticWarn" "WarningMsg" "#EED49F"];
info = ["DiagnosticInfo" "#EED49F"];
default = ["Identifier" "#F5A97F"];
test = ["Identifier" "#8AADF4"];
};
};
};
}

View file

@ -41,128 +41,130 @@
'';
plugins.conform-nvim = {
enable = true;
formatOnSave = ''
function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
if slow_format_filetypes[vim.bo[bufnr].filetype] then
return
end
local function on_format(err)
if err and err:match("timeout$") then
slow_format_filetypes[vim.bo[bufnr].filetype] = true
settings = {
format_on_save = ''
function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
if slow_format_filetypes[vim.bo[bufnr].filetype] then
return
end
local function on_format(err)
if err and err:match("timeout$") then
slow_format_filetypes[vim.bo[bufnr].filetype] = true
end
end
return { timeout_ms = 200, lsp_fallback = true }, on_format
end
'';
format_after_save = ''
function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
if not slow_format_filetypes[vim.bo[bufnr].filetype] then
return
end
return { lsp_fallback = true }
end
'';
notify_on_error = true;
formatters_by_ft = {
html = [
[
"prettierd"
"prettier"
]
];
css = [
[
"prettierd"
"prettier"
]
];
javascript = [
[
"prettierd"
"prettier"
]
];
typescript = [
[
"prettierd"
"prettier"
]
];
python = [
"black"
"isort"
];
lua = ["stylua"];
nix = ["alejandra"];
markdown = [
[
"prettierd"
"prettier"
]
];
yaml = [
[
"prettierd"
"prettier"
]
];
terraform = ["terraform_fmt"];
bicep = ["bicep"];
bash = [
"shellcheck"
"shellharden"
"shfmt"
];
json = ["jq"];
"_" = ["trim_whitespace"];
};
return { timeout_ms = 200, lsp_fallback = true }, on_format
end
'';
formatAfterSave = ''
function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
if not slow_format_filetypes[vim.bo[bufnr].filetype] then
return
end
return { lsp_fallback = true }
end
'';
notifyOnError = true;
formattersByFt = {
html = [
[
"prettierd"
"prettier"
]
];
css = [
[
"prettierd"
"prettier"
]
];
javascript = [
[
"prettierd"
"prettier"
]
];
typescript = [
[
"prettierd"
"prettier"
]
];
python = [
"black"
"isort"
];
lua = ["stylua"];
nix = ["alejandra"];
markdown = [
[
"prettierd"
"prettier"
]
];
yaml = [
[
"prettierd"
"prettier"
]
];
terraform = ["terraform_fmt"];
bicep = ["bicep"];
bash = [
"shellcheck"
"shellharden"
"shfmt"
];
json = ["jq"];
"_" = ["trim_whitespace"];
};
formatters = {
black = {
command = "${lib.getExe pkgs.black}";
formatters = {
black = {
command = "${lib.getExe pkgs.black}";
};
isort = {
command = "${lib.getExe pkgs.isort}";
};
alejandra = {
command = "${lib.getExe pkgs.alejandra}";
};
jq = {
command = "${lib.getExe pkgs.jq}";
};
prettierd = {
command = "${lib.getExe pkgs.prettierd}";
};
stylua = {
command = "${lib.getExe pkgs.stylua}";
};
shellcheck = {
command = "${lib.getExe pkgs.shellcheck}";
};
shfmt = {
command = "${lib.getExe pkgs.shfmt}";
};
shellharden = {
command = "${lib.getExe pkgs.shellharden}";
};
bicep = {
command = "${lib.getExe pkgs.bicep}";
};
#yamlfmt = {
# command = "${lib.getExe pkgs.yamlfmt}";
#};
};
isort = {
command = "${lib.getExe pkgs.isort}";
};
alejandra = {
command = "${lib.getExe pkgs.alejandra}";
};
jq = {
command = "${lib.getExe pkgs.jq}";
};
prettierd = {
command = "${lib.getExe pkgs.prettierd}";
};
stylua = {
command = "${lib.getExe pkgs.stylua}";
};
shellcheck = {
command = "${lib.getExe pkgs.shellcheck}";
};
shfmt = {
command = "${lib.getExe pkgs.shfmt}";
};
shellharden = {
command = "${lib.getExe pkgs.shellharden}";
};
bicep = {
command = "${lib.getExe pkgs.bicep}";
};
#yamlfmt = {
# command = "${lib.getExe pkgs.yamlfmt}";
#};
};
};
};

View file

@ -2,23 +2,28 @@
plugins = {
bufferline = {
enable = true;
diagnostics = "nvim_lsp";
mode = "buffers";
settings = {
options = {
diagnostics = "nvim_lsp";
mode = "buffers";
closeIcon = " ";
bufferCloseIcon = "󰱝 ";
modifiedIcon = "󰔯 ";
close_icon = " ";
buffer_close_icon = "󰱝 ";
modified_icon = "󰔯 ";
offsets = [
{
filetype = "neo-tree";
text = "Neo-tree";
highlight = "Directory";
text_align = "left";
}
];
offsets = [
{
filetype = "neo-tree";
text = "Neo-tree";
highlight = "Directory";
text_align = "left";
}
];
};
};
};
};
keymaps = [
{
mode = "n";