Compare commits

..

No commits in common. "688a457a3db07d8972ae7f8ceab1722b7e145f64" and "335fbea0c0a7813ea5612ab4070a32f4b860fba4" have entirely different histories.

2 changed files with 10 additions and 13 deletions

View File

@ -4,6 +4,7 @@
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.strings) optionalString;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
@ -13,7 +14,7 @@ in {
vim.startPlugins = ["nvim-autopairs"];
vim.luaConfigRC.autopairs = entryAnywhere ''
require("nvim-autopairs").setup({ map_cr = ${toLuaObject (!config.vim.autocomplete.enable)} })
require("nvim-autopairs").setup{}
'';
};
}

View File

@ -61,19 +61,15 @@ in {
(mkSetLuaBinding mappings.complete ''
require('cmp').complete
'')
(let
defaultKeys =
if config.vim.autopairs.enable
then "require('nvim-autopairs').autopairs_cr()"
else "vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)";
in
mkSetLuaBinding mappings.confirm ''
function()
if not require('cmp').confirm({ select = true }) then
vim.fn.feedkeys(${defaultKeys}, 'n')
end
(mkSetLuaBinding mappings.confirm ''
function()
if not require('cmp').confirm({ select = true }) then
local termcode = vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)
vim.fn.feedkeys(termcode, 'n')
end
'')
end
'')
(mkSetLuaBinding mappings.next ''
function()
local has_words_before = function()