about summary refs log tree commit diff stats
path: root/modules/by-name/nv/nvim/plgs
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name/nv/nvim/plgs')
-rw-r--r--modules/by-name/nv/nvim/plgs/luasnip/default.nix21
-rw-r--r--modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua17
2 files changed, 16 insertions, 22 deletions
diff --git a/modules/by-name/nv/nvim/plgs/luasnip/default.nix b/modules/by-name/nv/nvim/plgs/luasnip/default.nix
index 2faec553..e7c006a6 100644
--- a/modules/by-name/nv/nvim/plgs/luasnip/default.nix
+++ b/modules/by-name/nv/nvim/plgs/luasnip/default.nix
@@ -18,12 +18,23 @@ in {
   home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
     plugins.luasnip = {
       enable = true;
+
+      settings = {
+        # Enable auto triggered snippets.
+        enable_autosnippets = true;
+
+        # Use Tab to trigger visual selection.
+        store_selection_keys = "<Tab>";
+      };
+
+      fromLua = [
+        {
+          paths = ./lua/snippets;
+          lazyLoad = true;
+        }
+      ];
     };
-    extraConfigLuaPost = ''
-      ${lib.strings.fileContents ./lua/luasnip.lua};
-      require("luasnip.loaders.from_lua").load({paths = "${./lua/snippets}"});
-      require("luasnip.loaders.from_lua").lazy_load({paths = "${./lua/snippets}"});
-    '';
+
     extraPlugins = [
       # needed for the todo-comments snippets
       pkgs.vimPlugins.comment-nvim
diff --git a/modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua
deleted file mode 100644
index 88ced23a..00000000
--- a/modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua
+++ /dev/null
@@ -1,17 +0,0 @@
--- nixos-config - My current NixOS configuration
---
--- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
--- SPDX-License-Identifier: GPL-3.0-or-later
---
--- This file is part of my nixos-config.
---
--- You should have received a copy of the License along with this program.
--- If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-
-require("luasnip").config.set_config({
-  -- Enable auto triggered snippets
-  enable_autosnippets = true,
-
-  -- Use Tab (or some other key if you prefer) to trigger visual selection
-  store_selection_keys = "<Tab>",
-})