mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-23 21:09:48 +01:00
feat: enable vim-vsnip if nvim-cmp is enabled
This commit is contained in:
parent
a90f713fee
commit
5941502e37
2 changed files with 25 additions and 1 deletions
|
@ -35,6 +35,7 @@ in {
|
||||||
"cmp-buffer"
|
"cmp-buffer"
|
||||||
"cmp-vsnip"
|
"cmp-vsnip"
|
||||||
"cmp-path"
|
"cmp-path"
|
||||||
|
"vim-vsnip"
|
||||||
];
|
];
|
||||||
|
|
||||||
vim.autocomplete.sources = {
|
vim.autocomplete.sources = {
|
||||||
|
|
|
@ -5,7 +5,30 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with builtins; {
|
with builtins; let
|
||||||
|
cfg = config.vim.autocomplete;
|
||||||
|
lspkindEnabled = config.vim.lsp.enable && config.vim.lsp.lspkind.enable;
|
||||||
|
builtSources =
|
||||||
|
concatMapStringsSep
|
||||||
|
"\n"
|
||||||
|
(n: "{ name = '${n}'},")
|
||||||
|
(attrNames cfg.sources);
|
||||||
|
|
||||||
|
builtMaps =
|
||||||
|
concatStringsSep
|
||||||
|
"\n"
|
||||||
|
(mapAttrsToList
|
||||||
|
(n: v:
|
||||||
|
if v == null
|
||||||
|
then ""
|
||||||
|
else "${n} = '${v}',")
|
||||||
|
cfg.sources);
|
||||||
|
|
||||||
|
dagPlacement =
|
||||||
|
if lspkindEnabled
|
||||||
|
then nvim.dag.entryAfter ["lspkind"]
|
||||||
|
else nvim.dag.entryAnywhere;
|
||||||
|
in {
|
||||||
options.vim = {
|
options.vim = {
|
||||||
autocomplete = {
|
autocomplete = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
|
|
Loading…
Reference in a new issue