feat(nvim): add avante and split up plugins
This commit is contained in:
parent
44bcf963b2
commit
1aa1714237
12 changed files with 419 additions and 500 deletions
68
modules/programs/nvim/new_plugins/cmp.nix
Normal file
68
modules/programs/nvim/new_plugins/cmp.nix
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.cmp = {
|
||||
autoEnableSources = true;
|
||||
enable = true;
|
||||
settings.sources = [
|
||||
{ priority = 1; name = "async_path"; }
|
||||
{ priority = 1; name = "buffer"; }
|
||||
{ priority = 2; name = "nvim_lsp"; }
|
||||
{ priority = 3; name = "nvim_lsp_signature_help"; }
|
||||
{ priority = 4; name = "luasnip"; }
|
||||
{ priority = 4; name = "vimtex"; }
|
||||
];
|
||||
settings.mapping = {
|
||||
__raw = ''
|
||||
cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||
elseif require("luasnip").locally_jumpable(1) then
|
||||
require("luasnip").jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
|
||||
elseif require("luasnip").locally_jumpable(-1) then
|
||||
require("luasnip").jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<C-n>"] = cmp.mapping(function(fallback)
|
||||
if require("luasnip").choice_active() then
|
||||
require("luasnip").change_choice(1)
|
||||
elseif require("luasnip").locally_jumpable(1) then
|
||||
require("luasnip").jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<C-p>"] = cmp.mapping(function(fallback)
|
||||
if require("luasnip").choice_active() then
|
||||
require("luasnip").change_choice(-1)
|
||||
elseif require("luasnip").locally_jumpable(-1) then
|
||||
require("luasnip").jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
})
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue