nixvim/config/plugins.nix

103 lines
2.3 KiB
Nix
Raw Permalink Normal View History

2024-12-13 19:01:54 -07:00
{pkgs, ...}: {
plugins = {
2024-12-13 20:14:26 -07:00
lualine.enable = true;
2024-12-13 21:09:37 -07:00
undotree.enable = true;
2024-12-13 21:19:17 -07:00
bufferline.enable = true;
2024-12-14 08:14:13 -07:00
web-devicons.enable = true;
2024-12-14 12:51:51 -07:00
cmp-nvim-lsp.enable = true;
cmp-path.enable = true;
2024-12-13 19:01:54 -07:00
};
2024-12-13 21:01:33 -07:00
plugins.gitsigns = {
enable = true;
settings.current_line_blame = true;
};
2024-12-13 20:40:00 -07:00
plugins.lsp = {
enable = true;
servers = {
rust_analyzer = {
enable = true;
2024-12-16 15:39:22 -07:00
installRustc = true;
installCargo = true;
installRustfmt = true;
2024-12-13 20:40:00 -07:00
};
2024-12-14 10:21:56 -07:00
nil_ls.enable = true;
2024-12-13 20:40:00 -07:00
};
};
2024-12-14 08:14:22 -07:00
plugins.treesitter = {
enable = true;
settings.highlight.enable = true;
};
2024-12-14 12:51:51 -07:00
plugins.friendly-snippets = {
enable = true;
};
plugins.luasnip = {
enable = true;
settings = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
};
plugins.cmp = {
enable = true;
settings = {
autoEnableSources = true;
snippet = {
expand = ''
function(args)
require('luasnip').lsp_expand(args.body)
end
'';
};
sources = [
{ name = "nvim_lsp"; }
{
name = "path"; # file system paths
keywordLength = 2 ;
}
{
name = "luasnip"; # snippets
keywordLength = 2;
}
];
mapping = {
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<C-j>" = "cmp.mapping.select_next_item()";
"<C-k>" = "cmp.mapping.select_prev_item()";
"<C-e>" = "cmp.mapping.abort()";
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
"<C-l>" = ''
cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { 'i', 's' })
'';
"<C-h>" = ''
cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { 'i', 's' })
'';
};
};
};
2024-12-13 20:40:00 -07:00
2024-12-13 20:12:14 -07:00
colorschemes.catppuccin = {
enable = true;
settings.flavor = "frappe";
};
2024-12-13 21:13:16 -07:00
extraPlugins = ( with pkgs.vimPlugins; [
vim-be-good
]);
2024-12-13 19:01:54 -07:00
}