mirror of
https://github.com/softinio/nix-config.git
synced 2025-10-18 19:16:41 -07:00
Add neovim config using nixvim
This commit is contained in:
parent
5151384820
commit
2708a86df9
18 changed files with 864 additions and 9 deletions
65
programs/nixvim/completion.nix
Normal file
65
programs/nixvim/completion.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.nixvim = {
|
||||
opts.completeopt = [
|
||||
"menu"
|
||||
"menuone"
|
||||
"noselect"
|
||||
];
|
||||
|
||||
plugins = {
|
||||
luasnip.enable = true;
|
||||
|
||||
lspkind = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
cmp = {
|
||||
enable = true;
|
||||
menu = {
|
||||
nvim_lsp = "[LSP]";
|
||||
nvim_lua = "[api]";
|
||||
path = "[path]";
|
||||
luasnip = "[snip]";
|
||||
buffer = "[buffer]";
|
||||
cmp_tabby = "[Tabby]";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
cmp = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
snippet.expand = ''
|
||||
function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
'';
|
||||
|
||||
mapping = {
|
||||
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<C-e>" = "cmp.mapping.close()";
|
||||
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
||||
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
};
|
||||
|
||||
sources = [
|
||||
{ name = "path"; }
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "luasnip"; }
|
||||
{
|
||||
name = "buffer";
|
||||
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue