From 319fb0b56633426a4051bb10e0712a1bb242b3cb Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 12 Jul 2023 20:55:08 +0300 Subject: [PATCH] feat: add borders to nvim-cmp completion window --- modules/completion/nvim-cmp/config.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/completion/nvim-cmp/config.nix b/modules/completion/nvim-cmp/config.nix index 1cc4fa4..72c9a1a 100644 --- a/modules/completion/nvim-cmp/config.nix +++ b/modules/completion/nvim-cmp/config.nix @@ -182,6 +182,8 @@ in { '') ]; + # TODO: alternative snippet engines to vsnip + # https://github.com/hrsh7th/nvim-cmp/blob/main/doc/cmp.txt#L82 vim.luaConfigRC.completion = mkIf (cfg.type == "nvim-cmp") (dagPlacement '' local nvim_cmp_menu_map = function(entry, vim_item) -- name for each source @@ -195,19 +197,30 @@ in { ${optionalString lspkindEnabled '' lspkind_opts.before = ${cfg.formatting.format} ''} + local cmp = require'cmp' cmp.setup({ + window = { + -- TODO: at some point, those need to be optional + -- but first nvim cmp module needs to be detached from "cfg.autocomplete" + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, }, + sources = { ${builtSources} }, + completion = { completeopt = 'menu,menuone,noinsert', }, + formatting = { format = ${