fix(nvim): test dev.enable = false
All checks were successful
/ check (push) Successful in 28s
/ build (audiomenu) (push) Successful in 1s
/ build (docs) (push) Successful in 1s
/ build (jpassmenu) (push) Successful in 1s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Successful in 1s
/ build (nvim) (push) Successful in 1s

This caught a bug where we don't disable `conform` keymaps when
`dev.enable = false` (which disables `conform`).
This commit is contained in:
Jalil David Salamé Messina 2024-11-06 22:26:21 +01:00
parent 54c4343567
commit 84387f2597
Signed by: jalil
GPG key ID: F016B9E770737A0B
3 changed files with 277 additions and 249 deletions

View file

@ -1,6 +1,13 @@
{ helpers, ... }:
{
config,
helpers,
lib,
...
}:
let
inherit (helpers) mkRaw;
cfg = config.jhome.nvim;
dev = cfg.dev.enable;
in
{
config = {
@ -9,41 +16,43 @@ in
"lspConfig" = { };
"restoreCursorPosition" = { };
};
autoCmd = [
{
group = "highlightOnYank";
event = "TextYankPost";
pattern = "*";
callback =
mkRaw
# lua
''
function()
vim.highlight.on_yank {
higroup = (
vim.fn['hlexists'] 'HighlightedyankRegion' > 0 and 'HighlightedyankRegion' or 'IncSearch'
),
timeout = 200,
}
end
'';
}
{
group = "restoreCursorPosition";
event = "BufReadPost";
pattern = "*";
callback =
mkRaw
# lua
''
function()
if vim.fn.line '\'"' > 0 and vim.fn.line '\'"' <= vim.fn.line '$' then
vim.cmd [[execute "normal! g'\""]]
autoCmd =
[
{
group = "highlightOnYank";
event = "TextYankPost";
pattern = "*";
callback =
mkRaw
# lua
''
function()
vim.highlight.on_yank {
higroup = (
vim.fn['hlexists'] 'HighlightedyankRegion' > 0 and 'HighlightedyankRegion' or 'IncSearch'
),
timeout = 200,
}
end
end
'';
}
{
'';
}
{
group = "restoreCursorPosition";
event = "BufReadPost";
pattern = "*";
callback =
mkRaw
# lua
''
function()
if vim.fn.line '\'"' > 0 and vim.fn.line '\'"' <= vim.fn.line '$' then
vim.cmd [[execute "normal! g'\""]]
end
end
'';
}
]
++ lib.optional dev {
group = "lspConfig";
event = "LspAttach";
pattern = "*";
@ -94,7 +103,6 @@ in
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, { desc = '[G]o to [I]mplementation', ${opts} })
end
'';
}
];
};
};
}