{ config, lib, helpers, ... }: let inherit (helpers) mkRaw; in { # TJ # https://www.youtube.com/watch?v=_DnmphIwnjo plugins = { cmp = { enable = true; autoEnableSources = true; settings = { sources = lib.optionals config.plugins.lsp.enable [ { name = "nvim_lsp"; } ] ++ lib.optionals config.plugins.luasnip.enable [ { name = "luasnip"; option = { show_autosnippets = true; }; } ] ++ [ { name = "path"; } { name = "spell"; } { name = "latex_symbols"; } { name = "buffer"; keyword_length = 5; } ]; mapping = mkRaw '' cmp.mapping.preset.insert({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true, }), }) ''; snippet.expand = '' function(args) require('luasnip').lsp_expand(args.body) end ''; experimental = { # ghost_text = true; }; view.entries = { name = "custom"; # selection_order = "top_down"; }; }; }; }; }