mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-12-20 16:20:06 +01:00
34 lines
829 B
Nix
34 lines
829 B
Nix
|
|
{
|
||
|
|
config,
|
||
|
|
lib,
|
||
|
|
options,
|
||
|
|
...
|
||
|
|
}: let
|
||
|
|
inherit (lib.nvim.binds) mkKeymap;
|
||
|
|
cfg = config.vim.assistant.neocodeium;
|
||
|
|
|
||
|
|
inherit (options.vim.assistant.neocodeium) keymaps;
|
||
|
|
mkNeoCodeiumKey = act: (mkKeymap "i" cfg.keymaps.${act} "function() require('neocodeium').${act}() end" {
|
||
|
|
lua = true;
|
||
|
|
desc = keymaps.${act}.description;
|
||
|
|
});
|
||
|
|
in {
|
||
|
|
config = lib.mkIf cfg.enable {
|
||
|
|
vim = {
|
||
|
|
lazy.plugins.neocodeium = {
|
||
|
|
package = "neocodeium";
|
||
|
|
setupModule = "neocodeium";
|
||
|
|
inherit (cfg) setupOpts;
|
||
|
|
};
|
||
|
|
keymaps = [
|
||
|
|
(mkNeoCodeiumKey "accept")
|
||
|
|
(mkNeoCodeiumKey "accept_word")
|
||
|
|
(mkNeoCodeiumKey "accept_line")
|
||
|
|
(mkNeoCodeiumKey "cycle_or_complete")
|
||
|
|
(mkNeoCodeiumKey "cycle_or_complete_reverse")
|
||
|
|
(mkNeoCodeiumKey "clear")
|
||
|
|
];
|
||
|
|
};
|
||
|
|
};
|
||
|
|
}
|