Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

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 (`n``) mode don't take effect when you do something like hit the `d` key to do a deletion. Getting that to work requires making a second keymap for the `o` mode. For example:

Code

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 `j`` and `k``. With the remapping I can press `j`` 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