From f0ac85d6fa5d393efaf4b31a4ce4f87882d75a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 31 Jul 2025 16:19:36 +0200 Subject: [PATCH] feat(nvim): add lazydev --- .../programs/nvim/plugins/blink-cmp.nix | 38 +++++++++++++------ .../moritz/programs/nvim/plugins/lazydev.nix | 3 ++ 2 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 modules/moritz/programs/nvim/plugins/lazydev.nix diff --git a/modules/moritz/programs/nvim/plugins/blink-cmp.nix b/modules/moritz/programs/nvim/plugins/blink-cmp.nix index 836e995..1dbc300 100644 --- a/modules/moritz/programs/nvim/plugins/blink-cmp.nix +++ b/modules/moritz/programs/nvim/plugins/blink-cmp.nix @@ -1,4 +1,10 @@ -{...}: { +{ + lib, + config, + ... +}: let + lazydevEnabled = config.home-manager.users.moritz.programs.nixvim.plugins.lazydev.enable; +in { home-manager.users.moritz.programs.nixvim = { plugins.blink-compat.enable = true; plugins.lsp.capabilities = @@ -16,16 +22,26 @@ }; appearance.nerd_font_variant = "mono"; sources = { - default = [ - "lsp" - "path" - "snippets" - "buffer" - "vimtex" - ]; - providers.vimtex = { - name = "vimtex"; - module = "blink.compat.source"; + default = + [ + "lsp" + "path" + "snippets" + "buffer" + "vimtex" + ] + ++ lib.optional lazydevEnabled "lazydev"; + providers = { + vimtex = { + name = "vimtex"; + module = "blink.compat.source"; + }; + lazydev = lib.mkIf lazydevEnabled { + name = "LazyDev"; + module = "lazydev.integrations.blink"; + # make lazydev completions top priority (see `:h blink.cmp`) + score_offset = 100; + }; }; }; signature.enabled = true; diff --git a/modules/moritz/programs/nvim/plugins/lazydev.nix b/modules/moritz/programs/nvim/plugins/lazydev.nix new file mode 100644 index 0000000..b65f840 --- /dev/null +++ b/modules/moritz/programs/nvim/plugins/lazydev.nix @@ -0,0 +1,3 @@ +_: { + home-manager.users.moritz.programs.nixvim.plugins.lazydev.enable = true; +}