chore: refactor
This commit is contained in:
parent
feb7679637
commit
92dcce1c43
|
@ -2,23 +2,30 @@
|
||||||
# Autocompletion plugin
|
# Autocompletion plugin
|
||||||
plugins.cmp = {
|
plugins.cmp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
autoEnableSources = true;
|
||||||
|
|
||||||
# Options provided to the require('cmp').setup function.
|
# Options provided to the require('cmp').setup function.
|
||||||
settings = {
|
settings = {
|
||||||
# The sources to use
|
# The sources to use
|
||||||
sources = [
|
sources = [
|
||||||
{name = "nvim_lsp";} # LSP source for cmp
|
{ # Language Server Protocol
|
||||||
{name = "luasnip";} # Snippets source for cmp
|
name = "nvim_lsp";
|
||||||
{name = "path";} # Filesystem paths
|
}
|
||||||
|
|
||||||
|
{ # Buffer Words
|
||||||
|
name = "buffer";
|
||||||
|
}
|
||||||
|
|
||||||
|
{ # Filesystem paths
|
||||||
|
name = "path";
|
||||||
|
}
|
||||||
|
|
||||||
|
{ # Command line
|
||||||
|
name = "cmdline";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
# The snippet expansion function.
|
|
||||||
snippet.expand =
|
# Key mappings for the completion menu.
|
||||||
#Lua
|
|
||||||
''
|
|
||||||
function(args)
|
|
||||||
require('luasnip').lsp_expand(args.body)
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
# cmp mappings declaration
|
|
||||||
mapping = {
|
mapping = {
|
||||||
"<esc>" =
|
"<esc>" =
|
||||||
# Lua
|
# Lua
|
||||||
|
@ -34,7 +41,5 @@
|
||||||
"cmp.mapping.confirm({ select = true, behavior = cmp.ConfirmBehavior.Replace })";
|
"cmp.mapping.confirm({ select = true, behavior = cmp.ConfirmBehavior.Replace })";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# Scans the sources array and enable the corresponding plugins if they are known to nixvim.
|
|
||||||
autoEnableSources = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue