Reputation: 25
just following theprimeagen neovim setup tutorial, try to map Ex to pv not working.
print("Setting leader key")
vim.g.mapleader = " "
print("Setting key mapping")
vim.keymap.set('n', '<leader>pv', vim.cmd.Ex)
print("Configuration loaded")
Setting leader key
Setting key mapping
Configuration loaded
Press ENTER or type command to continue
the debug info seems to be working
and also in :map
n <Space>pv * <Lua 29: vim/_editor.lua:0>
but when i try : pv
E492:Not an editor command: pv
Upvotes: 1
Views: 645
Reputation: 4807
You set a Normal mode mapping, as in :help key-mapping
. This is accessible directly from Normal mode by pressing the sequence of keys pv
(that's SpacePV).
You must not prefix a colon.
You're confusing mappings with user-defined commands, explained in :help user-commands
.
By the way, user-defined commands have to start with a capital letter to avoid confusion with the build-in Ex commands. Even if you were defining a command, it would need to be either :Pv
or :PV
.
My recommendation would be to familiarize yourself with your editor's features by means of the built-in documentation like :help user-manual
before trying to follow online resources. You need to understand the basics before you can tweak them. Just my two cents, though.
Upvotes: 2