diff --git a/hmModules/apps/neovim/app.nix b/hmModules/apps/neovim/app.nix index 29c03ae..4f27fdd 100644 --- a/hmModules/apps/neovim/app.nix +++ b/hmModules/apps/neovim/app.nix @@ -68,11 +68,11 @@ smartcase = true; }; - keymaps = [ + keymaps = with config.lib.nixvim; [ { key = "d"; mode = "n"; - action = "vim.diagnostic.open_float()"; + action = mkRaw "vim.diagnostic.open_float"; } # -- Easy Split Navigation # -- nnoremap @@ -111,50 +111,20 @@ cmp = { enable = nvimcmp.enable; autoEnableSources = true; - settings.sources = [ - { name = "nvim_lsp"; } - { name = "path"; } - { name = "buffer"; } - ] ++ lib.optional luasnip.enable { name = "cmp-luasnip"; }; + settings = { + sources = [ + { name = "nvim_lsp"; } + { name = "path"; } + { name = "buffer"; } + ] ++ lib.optional luasnip.enable { name = "cmp-luasnip"; }; - mapping = { - "" = "cmp.mapping.complete {}"; - "" = "cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }"; - "" = { - actions = '' - function(fallback) - if cmp.visible() then - cmp.select_next_item() - '' + lib.optionalString luasnip.enable '' - elseif luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - '' + '' - else - fallback() - end - end - ''; - modes = [ "i" "s" ]; - }; - "" = { - actions = '' - function(fallback) - if cmp.visible() then - cmp.select_prev_item() - '' + lib.optionalString luasnip.enable '' - elseif luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - '' + '' - else - fallback() - end - end - ''; - modes = [ "i" "s" ]; - }; + mapping = with config.lib.nixvim; { + "" = mkRaw "cmp.mapping.abort()"; + "" = mkRaw + "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; + "" = mkRaw + "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; + }; }; }; @@ -179,7 +149,7 @@ enable = treesitter.enable; highlight.enable = true; indent.enable = true; - folding.enable = true; + folding.enable = false; }; vimwiki = {