You mapping look good.
But you have mapped against <leader>n
which is by default: \n
Unless you have define: g:mapleader
.
You can know the value of g:mapleader
by running the following Neovim command:
echo "'" . g:mapleader . "'"
Some people (including myself) and some distributions (including NvChad, LunarVim, LazyVim, AstroVim) defines g:mapleader
to Space
In such case <leader>n
corresponds to Spacen
The result of the print
call should be visible as the output of the following Neovim
command
:messages
I you want to see the messages when they are triggered in Visual mode you have to increase the room for them with:
:set cmdheight=2