treewide: make the entire generated config lua based

This commit is contained in:
diniamo 2024-07-13 17:02:45 +02:00
commit eba3fa831e
17 changed files with 168 additions and 288 deletions

View file

@ -12,7 +12,7 @@
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.dag) entryAfter;
packageToCmd = package: defaultCmd:
if isList cfg.lsp.package
@ -141,7 +141,7 @@ in {
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.cHeader {
vim.configRC.c-header = entryAnywhere "let g:c_syntax_for_h = 1";
vim.luaConfigRC.c-header = entryAfter ["basic"] "vim.g.c_syntax_for_h = 1";
})
(mkIf cfg.treesitter.enable {

View file

@ -176,8 +176,16 @@ in {
config = mkIf cfg.enable (mkMerge [
{
vim.configRC.nix = entryAnywhere ''
autocmd filetype nix setlocal tabstop=2 shiftwidth=2 softtabstop=2
vim.luaConfigRC.nix = ''
vim.api.nvim_create_autocmd("FileType", {
pattern = "nix",
callback = function(opts)
bo = vim.bo[opts.buf]
bo.tabstop = 2
bo.shiftwidth = 2
bo.softtabstop = 2
end
})
'';
}