add config
This commit is contained in:
116
config/plugins/cmp/cmp.nix
Normal file
116
config/plugins/cmp/cmp.nix
Normal file
@ -0,0 +1,116 @@
|
||||
{
|
||||
plugins = {
|
||||
cmp-emoji.enable = true;
|
||||
cmp-nvim-lsp.enable = true;
|
||||
cmp-buffer.enable = true;
|
||||
cmp-path.enable = true;
|
||||
cmp_luasnip.enable = true;
|
||||
cmp-cmdline.enable = false;
|
||||
cmp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
autoEnableSources = true;
|
||||
experimental = {ghost_text = false;};
|
||||
performance = {
|
||||
debounce = 60;
|
||||
fetchingTimeout = 200;
|
||||
maxViewEntries = 30;
|
||||
};
|
||||
snippet = {expand = "luasnip";};
|
||||
formatting = {fields = ["kind" "abbr" "menu"];};
|
||||
sources = [
|
||||
{name = "git";}
|
||||
{name = "nvim_lsp";}
|
||||
{name = "emoji";}
|
||||
{
|
||||
name = "buffer"; # text within current buffer
|
||||
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
||||
keywordLength = 3;
|
||||
}
|
||||
{
|
||||
name = "path"; # file system paths
|
||||
keywordLength = 3;
|
||||
}
|
||||
{
|
||||
name = "luasnip"; # snippets
|
||||
keywordLength = 3;
|
||||
}
|
||||
];
|
||||
|
||||
window = {
|
||||
completion = {border = "solid";};
|
||||
documentation = {border = "solid";};
|
||||
};
|
||||
|
||||
mapping = {
|
||||
"<C-Tab>" =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
"cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
||||
"<Down>" =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
"cmp.mapping.select_next_item()";
|
||||
"<Up>" =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
"cmp.mapping.select_prev_item()";
|
||||
"<C-e>" =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
"cmp.mapping.abort()";
|
||||
"<C-b>" =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
"cmp.mapping.scroll_docs(-4)";
|
||||
"<C-f>" =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
"cmp.mapping.scroll_docs(4)";
|
||||
"<C-Space>" =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
"cmp.mapping.complete()";
|
||||
"<CR>" =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
"cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
|
||||
"<TAB>" =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end
|
||||
'';
|
||||
"<S-TAB>" =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
9
config/plugins/cmp/lspkind.nix
Normal file
9
config/plugins/cmp/lspkind.nix
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
plugins.lspkind = {
|
||||
enable = true;
|
||||
extraOptions = {
|
||||
maxwidth = 50;
|
||||
ellipsis_char = "...";
|
||||
};
|
||||
};
|
||||
}
|
13
config/plugins/cmp/schemastore.nix
Normal file
13
config/plugins/cmp/schemastore.nix
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
plugins.schemastore = {
|
||||
enable = true;
|
||||
|
||||
json = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
yaml = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user