Skip to content

Commit

Permalink
home (nvim): Configure auto completion
Browse files Browse the repository at this point in the history
  • Loading branch information
britter committed Nov 7, 2024
1 parent aaee728 commit 00753b5
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion home/terminal/nvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,40 @@ in {
globals.mapleader = " ";
plugins = {
bufferline.enable = true;
cmp.enable = true;
# Review the configuration for cmp after switching to 24.11
cmp = {
enable = true;
autoEnableSources = true;
settings = {
mapping = {
"<C-Space>" = "cmp.mapping.complete()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-e>" = "cmp.mapping.close()";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
};
snippet = {
expand = "function(args) require('luasnip').lsp_expand(args.body) end";
};
sources = [
{name = "nvim_lsp";}
{name = "luasnip";}
{name = "buffer";}
];
};
};
cmp_luasnip.enable = true;
luasnip = {
enable = true;
extraConfig = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
fromVscode = [{}];
};
friendly-snippets.enable = true;
gitsigns = {
enable = true;
settings.current_line_blame = true;
Expand Down

0 comments on commit 00753b5

Please sign in to comment.