# 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 . { config, lib, ... }: let cfg = config.soispha.programs.nvim; in { home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { opts.completeopt = [ "menu" # Show completions in a menu "menuone" # Also open menu, when only one completion exists "noselect" # Do not pre select one of the completions ]; keymaps = [ { key = "hh"; mode = ["i"]; action.__raw = '' function() require('cmp').select_next_item() end ''; options.desc = "go forward in completion menu"; } { key = "uu"; mode = ["i"]; action.__raw = '' function() require('cmp').confirm() end ''; options.desc = "confirm the selected item"; } { key = ""; mode = ["i"]; action.__raw = '' function() require('cmp').mapping.scroll_docs(-4) end ''; options.desc = "Scroll up by four lines"; } { key = ""; mode = ["i"]; action.__raw = '' function() require('cmp').mapping.scroll_docs(4) end ''; options.desc = "Scroll down by four lines"; } ]; plugins.cmp = { enable = true; autoEnableSources = true; settings = { mapping = {}; snippet.expand.__raw = '' function(args) require('luasnip').lsp_expand(args.body) end ''; sources = [ {name = "nvim_lsp";} {name = "luasnip";} {name = "path";} {name = "git";} # TODO: I might want to add config to allow all issues/prs <2023-10-16> # {name = "convertionalcommits";} # TODO: Useless without commitlint [https://commitlint.js.org/] <2023-10-16> # {name = "rg";} # TODO: This might really RIP-grep my system <2023-10-16> # {name = "buffer";} # {name = "digraphs";} {name = "calc";} ]; }; }; }; }