From e55592a4d504e25d47cbdb134531e934d269ae6d Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 13 Feb 2024 00:24:02 +0000 Subject: [PATCH] Revert "home-manager/neovim: use vim.keymap.set instead vim.cmd" This reverts commit e62e753fa9c354da8be1b037ce6094c14ece588f. --- home-manager/editor/neovim.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/home-manager/editor/neovim.nix b/home-manager/editor/neovim.nix index dc6e645e..94d8ce41 100644 --- a/home-manager/editor/neovim.nix +++ b/home-manager/editor/neovim.nix @@ -459,16 +459,21 @@ in { # Workaround issue with those mappings being overwritten by some # plugins, needs to be Lua since it needs to load later than - # vimscript + # vimscript, however for some reason vim.keymap.set is giving errors + # here plugin = pkgs.writeText "50-completion-maps" ""; type = "lua"; config = /* lua */ '' - local opts = { silent = true, expr = true } - local keys = { 'i', 'c' } - - vim.keymap.set(keys, '', function() return vim.fn.pumvisible() ~= 0 and '' or '' end, opts) - vim.keymap.set(keys, '', function() return vim.fn.pumvisible() ~= 0 and '' or '' end, opts) - vim.keymap.set(keys, '', function() return vim.fn.pumvisible() ~= 0 and '' or '' end, opts) + vim.cmd [[ + " insert mode + inoremap pumvisible() ? "" : "" + inoremap pumvisible() ? "" : "" + inoremap pumvisible() ? "" : "" + " command line + cnoremap pumvisible() ? "" : "" + cnoremap pumvisible() ? "" : "" + cnoremap pumvisible() ? "" : "" + ]] ''; } ]