treewide: make the entire generated config lua based (#333)

* modules: switch to gerg's neovim-wrapper

* modules: use initViml instead of writing the file

* treewide: make the entire generated config lua based

* docs: remove mentions of configRC

* plugins/treesitter: remove vim.cmd hack

* treewide: move resolveDag to lib

* modules/wrapper(rc): fix typo

* treewide: migrate to pluginRC for correct DAG order

The "new" DAG order is as follows:
- (luaConfigPre)
- globalsScript
- basic
- theme
- pluginConfigs
- extraPluginConfigs
- mappings
- (luaConfigPost)

* plugins/theme: fix theme DAG place

* plugins/theme: fix fixed theme DAG place

* modules/wrapper(rc): add removed option module for configRC

* docs: add dag-entries chapter, add release note entry

* fix: formatting CI

* languages/nix: add missing `local`

* docs: fix page link

* docs: add mention of breaking changes at the start of the release notes

* plugins/neo-tree: convert to pluginRC

* modules/wrapper(rc): add back entryAnywhere

* modules/wrapper(rc): expose pluginRC

* apply raf patch

---------

Co-authored-by: NotAShelf <raf@notashelf.dev>
This commit is contained in:
diniamo 2024-07-20 10:30:48 +02:00 committed by GitHub
commit f9789432f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
84 changed files with 389 additions and 404 deletions

View file

@ -11,7 +11,7 @@ in {
config = mkIf cfg.enable {
vim.startPlugins = ["cheatsheet-nvim"];
vim.luaConfigRC.cheaetsheet-nvim = entryAnywhere ''
vim.pluginRC.cheaetsheet-nvim = entryAnywhere ''
require('cheatsheet').setup({})
'';
};

View file

@ -13,7 +13,7 @@ in {
config = mkIf cfg.enable {
vim.startPlugins = ["which-key"];
vim.luaConfigRC.whichkey = entryAnywhere ''
vim.pluginRC.whichkey = entryAnywhere ''
local wk = require("which-key")
wk.setup ({
key_labels = {

View file

@ -13,7 +13,7 @@ in {
"ccc"
];
vim.luaConfigRC.ccc = entryAnywhere ''
vim.pluginRC.ccc = entryAnywhere ''
local ccc = require("ccc")
ccc.setup {
highlighter = {

View file

@ -25,7 +25,7 @@ in {
})
];
vim.luaConfigRC.gesture-nvim = entryAnywhere ''
vim.pluginRC.gesture-nvim = entryAnywhere ''
vim.opt.mouse = "a"
local gesture = require("gesture")

View file

@ -14,7 +14,7 @@ in {
"dressing-nvim"
];
vim.luaConfigRC.icon-picker = entryAnywhere ''
vim.pluginRC.icon-picker = entryAnywhere ''
require("icon-picker").setup({
disable_legacy_commands = true
})

View file

@ -19,7 +19,7 @@ in {
"magick"
];
luaConfigRC.image-nvim = entryAnywhere ''
pluginRC.image-nvim = entryAnywhere ''
require("image").setup(
${toLuaObject cfg.setupOpts}
)

View file

@ -19,7 +19,7 @@ in {
vim.maps.normal = mkSetBinding mappings.hop "<cmd> HopPattern<CR>";
vim.luaConfigRC.hop-nvim = entryAnywhere ''
vim.pluginRC.hop-nvim = entryAnywhere ''
require('hop').setup()
'';
};

View file

@ -37,7 +37,7 @@ in {
(mkBinding cfg.mappings.leapFromWindow "<Plug>(leap-from-window)" "Leap from window")
];
vim.luaConfigRC.leap-nvim = entryAnywhere ''
vim.pluginRC.leap-nvim = entryAnywhere ''
require('leap').opts = {
max_phase_one_targets = nil,
highlight_unlabeled_phase_one_targets = false,

View file

@ -25,7 +25,7 @@ in {
"<leader>pm" = "+Preview Markdown";
};
vim.luaConfigRC.glow = entryAnywhere ''
vim.pluginRC.glow = entryAnywhere ''
require('glow').setup({
glow_path = "${pkgs.glow}/bin/glow"
});

View file

@ -4,25 +4,23 @@
lib,
...
}: let
inherit (lib.strings) optionalString stringLength concatMapStringsSep;
inherit (lib.strings) stringLength concatMapStringsSep;
inherit (lib.modules) mkIf;
inherit (lib.nvim.vim) mkVimBool;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.utility.preview.markdownPreview;
in {
config = mkIf cfg.enable {
vim.startPlugins = [pkgs.vimPlugins.markdown-preview-nvim];
vim.configRC.markdown-preview = entryAnywhere ''
let g:mkdp_auto_start = ${mkVimBool cfg.autoStart}
let g:mkdp_auto_close = ${mkVimBool cfg.autoClose}
let g:mkdp_refresh_slow = ${mkVimBool cfg.lazyRefresh}
let g:mkdp_filetypes = [${concatMapStringsSep ", " (x: "'" + x + "'") cfg.filetypes}]
let g:mkdp_command_for_global = ${mkVimBool cfg.alwaysAllowPreview}
let g:mkdp_open_to_the_world = ${mkVimBool cfg.broadcastServer}
${optionalString (stringLength cfg.customIP > 0) "let g:mkdp_open_ip = '${cfg.customIP}'"}
${optionalString (stringLength cfg.customPort > 0) "let g:mkdp_port = '${cfg.customPort}'"}
'';
vim.globals = {
mkdp_auto_start = cfg.autoStart;
mkdp_auto_close = cfg.autoClose;
mkdp_refresh_slow = cfg.lazyRefresh;
mkdp_filetypes = [(concatMapStringsSep ", " (x: "'" + x + "'") cfg.filetypes)];
mkdp_command_for_global = cfg.alwaysAllowPreview;
mkdp_open_to_the_world = cfg.broadcastServer;
mkdp_open_ip = mkIf (stringLength cfg.customIP > 0) cfg.customIP;
mkdp_port = mkIf (stringLength cfg.customPort > 0) cfg.customPort;
};
};
}

View file

@ -18,7 +18,7 @@ in {
"nvim-surround"
];
luaConfigRC.surround = entryAnywhere ''
pluginRC.surround = entryAnywhere ''
require('nvim-surround').setup()
'';

View file

@ -65,7 +65,7 @@ in {
"<leader>fvc" = "Commits";
};
vim.luaConfigRC.telescope = entryAnywhere ''
vim.pluginRC.telescope = entryAnywhere ''
local telescope = require('telescope')
telescope.setup(${toLuaObject cfg.setupOpts})

View file

@ -5,21 +5,14 @@
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.utility.vim-wakatime;
in {
config = mkIf cfg.enable {
vim.startPlugins = [
pkgs.vimPlugins.vim-wakatime
];
vim.startPlugins = [pkgs.vimPlugins.vim-wakatime];
vim.configRC.vim-wakatime = entryAnywhere ''
${
if cfg.cli-package == null
then ""
else ''let g:wakatime_CLIPath = "${cfg.cli-package}"''
}
vim.pluginRC.vim-wakatime = mkIf (cfg.cli-package != null) ''
vim.g.wakatime_CLIPath = "${cfg.cli-package}"
'';
};
}