# nixos-config - My current NixOS configuration # # Copyright (C) 2025 Benedikt Peetz # 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 . { lib, config, pkgs, ... }: let cfg = config.soispha.programs.nvim; in { home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { keymaps = [ { key = ""; mode = ["i"]; action.__raw = '' function() require('luasnip').expand() end ''; options = { # silent = true; desc = "Expand the snippet"; }; } { key = ""; mode = ["i" "s"]; action.__raw = '' function() require('luasnip').jump(1) end ''; options = { # silent = true; desc = "Jump forward in snippet insert nodes"; }; } { key = ""; mode = ["i" "s"]; action.__raw = '' function() require('luasnip').jump(-1) end ''; options = { # silent = true; desc = "Jump backwards in snippet insert nodes"; }; } { key = ""; mode = ["i" "s"]; action.__raw = '' function() if require('luasnip').choice_active() then require('luasnip').change_choice(1) end end ''; options = { # silent = true; desc = "Cycle through the snippets choice nodes"; }; } ]; plugins.luasnip = { enable = true; settings = { # Enable auto triggered snippets. enable_autosnippets = true; # Use Tab to trigger visual selection. store_selection_keys = ""; }; fromLua = [ { paths = ./snippets; lazyLoad = true; } ]; }; extraPlugins = [ # needed for the todo-comments snippets pkgs.vimPlugins.comment-nvim ]; }; }