Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Change A Neovim Keymapping To Work With Delete

I use a moonlander and have remapped may keyboard considerally. I've updated a few Neovim keybindings as well to make things more natural.

One thing that took a bit to figure out is that keys that are mapped in Normal ( [TODO: Code shorthand span ] ) mode don't take effect when you do something like hit the [TODO: Code shorthand span ] key to do a deletion. Getting that to work requires making a second keymap for the [TODO: Code shorthand span ] mode. For example :

lua
vim.keymap.set('n', '(', "`}", {})
vim.keymap.set('o', '(', "`}", {})

vim.keymap.set('n', ')', "`{", {})
vim.keymap.set('o', ')', "`{", {})

This setup calls the a curly bracket of facing the opposite direction when I type a parenthesis. My parens have been remapped to be under [TODO: Code shorthand span ] and [TODO: Code shorthand span ] . With the remapping I can press [TODO: Code shorthand span ] to jump down a line then shift the layer and hit it again to jump down a paragraph.

It works great.

Dealing with deletes in Neovim keymapping