mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-07 22:55:58 +01:00
Merge pull request #91 from NotAShelf/transparent-nvim-cmp
feature/bordered completion windows
This commit is contained in:
commit
75e796a981
1 changed files with 13 additions and 0 deletions
|
@ -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 ''
|
vim.luaConfigRC.completion = mkIf (cfg.type == "nvim-cmp") (dagPlacement ''
|
||||||
local nvim_cmp_menu_map = function(entry, vim_item)
|
local nvim_cmp_menu_map = function(entry, vim_item)
|
||||||
-- name for each source
|
-- name for each source
|
||||||
|
@ -195,19 +197,30 @@ in {
|
||||||
${optionalString lspkindEnabled ''
|
${optionalString lspkindEnabled ''
|
||||||
lspkind_opts.before = ${cfg.formatting.format}
|
lspkind_opts.before = ${cfg.formatting.format}
|
||||||
''}
|
''}
|
||||||
|
|
||||||
local cmp = require'cmp'
|
local cmp = require'cmp'
|
||||||
cmp.setup({
|
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 = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
vim.fn["vsnip#anonymous"](args.body)
|
vim.fn["vsnip#anonymous"](args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
sources = {
|
sources = {
|
||||||
${builtSources}
|
${builtSources}
|
||||||
},
|
},
|
||||||
|
|
||||||
completion = {
|
completion = {
|
||||||
completeopt = 'menu,menuone,noinsert',
|
completeopt = 'menu,menuone,noinsert',
|
||||||
},
|
},
|
||||||
|
|
||||||
formatting = {
|
formatting = {
|
||||||
format =
|
format =
|
||||||
${
|
${
|
||||||
|
|
Loading…
Reference in a new issue