Compare commits

..

5 Commits

Author SHA1 Message Date
098a4f4ad7 Rust Format On Save 2024-12-14 16:17:44 -07:00
84cca21775 Autocomplete & Snippets 2024-12-14 12:51:51 -07:00
216f1ca571 Nix LSP 2024-12-14 10:21:56 -07:00
920ae0bae3 Treesitter 2024-12-14 08:14:22 -07:00
cce6642765 Devicons 2024-12-14 08:14:13 -07:00
2 changed files with 70 additions and 0 deletions

View File

@ -7,4 +7,5 @@
# Save Undo History # Save Undo History
undofile = true; undofile = true;
}; };
extraConfigLua = "vim.g.rustfmt_autosave = 1";
} }

View File

@ -3,6 +3,10 @@
lualine.enable = true; lualine.enable = true;
undotree.enable = true; undotree.enable = true;
bufferline.enable = true; bufferline.enable = true;
web-devicons.enable = true;
cmp-nvim-lsp.enable = true;
cmp-path.enable = true;
}; };
plugins.gitsigns = { plugins.gitsigns = {
@ -18,6 +22,71 @@
installRustc = false; installRustc = false;
installCargo = false; installCargo = false;
}; };
nil_ls.enable = true;
};
};
plugins.treesitter = {
enable = true;
settings.highlight.enable = true;
};
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' })
'';
};
}; };
}; };