init
This commit is contained in:
commit
1e2ca5a6fc
71 changed files with 3330 additions and 0 deletions
66
config/plugins/cmp.nix
Normal file
66
config/plugins/cmp.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
helpers,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (helpers) mkRaw;
|
||||
in
|
||||
{
|
||||
# TJ
|
||||
# https://www.youtube.com/watch?v=_DnmphIwnjo
|
||||
plugins = {
|
||||
cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
settings = {
|
||||
sources =
|
||||
lib.optionals config.plugins.lsp.enable [
|
||||
{ name = "nvim_lsp"; }
|
||||
]
|
||||
++ lib.optionals config.plugins.luasnip.enable [
|
||||
{
|
||||
name = "luasnip";
|
||||
option = {
|
||||
show_autosnippets = true;
|
||||
};
|
||||
}
|
||||
]
|
||||
++ [
|
||||
{ name = "path"; }
|
||||
{ name = "spell"; }
|
||||
{ name = "latex_symbols"; }
|
||||
{
|
||||
name = "buffer";
|
||||
keyword_length = 5;
|
||||
}
|
||||
];
|
||||
mapping = mkRaw ''
|
||||
cmp.mapping.preset.insert({
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<C-y>'] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
}),
|
||||
})
|
||||
'';
|
||||
snippet.expand = ''
|
||||
function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
'';
|
||||
experimental = {
|
||||
# ghost_text = true;
|
||||
};
|
||||
view.entries = {
|
||||
name = "custom";
|
||||
# selection_order = "top_down";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue