I am trying to set <leader>pv as :Ex but always it shows E492: Not and editor command: ,pv Basically the newly added command mapping is not setting up or saving properly. I do not know what to do.

       vim.keymap.set("n", " ", "<Nop>", { silent = true, remap = false })

       vim.g.mapleader = " "

       vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)

I am using NVIM 0.9.2 on MacOS and Brew with iTerm2

Using :Telescope keymaps I can see <Space>pv is shown as anonymous

  • Did you solved your problem? How could we help you further? Commented Sep 23, 2023 at 6:03
  • @Vivian De Smedt Unfortunately, no. Since, I am using brew and I have vim, nvim, lunarvim all installed and If nobody else is facing the issue prominently, it must have been some conflict from my side. Once I get the chance to find the issue or solution again I will definitely give an update. For now I am not using vim/vnim as it takes to much time for a starter like me, but I will definitely look around at spare time. A lot of thanks to the community and you!
    – piedpipr
    Commented Sep 24, 2023 at 15:55

1 Answer 1


I would do:

lua vim.keymap.set("n", "<leader>pv", '<cmd>:Ex<cr>', { remap = false })
  • Still same issue E492: Not and editor command: pv
    – piedpipr
    Commented Sep 17, 2023 at 20:29
  • Do you put the command in init.vim or in init.lua or do you execute it from the Neovim command prompt? Commented Sep 18, 2023 at 1:29
  • You should type the keys Space,p,v in Normal mode @piedpipr
    – D. Ben Knoble
    Commented Sep 18, 2023 at 15:04
  • 1
    @piedpipr what @Ben suspect is that you are actually in command mode or that you are typing : pv and not just ` pv`. Commented Sep 18, 2023 at 15:19
  • 1
    But what if you don't type the colon (:) and only type: <space>pv? Commented Sep 19, 2023 at 3:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.