Keybinds and keyboard layouts

Thats why I have customized Neovim insert mode keybinds to insert pairs of things around my cursor so that I don’t have to leave the home row to type things like:

''
""
()
[]
{}

I type ,g to insert {}.
Btw. ,<space> becomes ,<space> and ,, becomes ,, so that means only if I would want to type ,g literally it becomes more awkward (I need to wait a little bit instead of typing it fast) but because most of the time in normal use you type a space after a comma it really works to use comma with some other non-space character as an insert mode shortcut to insert some specific text.

In the past I also used this for other awkward to type sequences of characters that kept repeating, basically changing these shortcuts based on what is most annoying to type at the time.

Personally I think customizing keybinds is a must, it makes your life so much more ergonomic. I was considering to actually try steno-typing instead, which would be the full realization of custom chords instead of custom keybinds and I saw some cool video demonstrations of it, but I haven’t given that a serious attempt yet.

3 Likes

This sounds like something I would like to try, would you be willing to share your Neovim mappings for this?

We have similar issues on Swedish keyboards. To make it worse I switch between Mac OS and Windows on a daily basis and they use different key combinations for the curly braces.

As a (Latin American) Spanish keyboard native user, my heart goes out to all of you. I switched to an American layout (and later to an American keyboard) a long time ago, and never looked back.

BTW, I also gave up on all accent marks (á, é, í, ó, ú) when typing Spanish, although my mom, a Spanish teacher, wants to disinherit me every time we chat.

4 Likes

That’s the reason why I’m using only QWERTY keyboards with my own driver. Luckily, we only have a few characters in Germany (äöüß) which I can then easily create with my function key.

1 Like

I am using LazyVim, I have this configured in my ~/.config/nvim/lua/config/keymaps.lua:

-- to allow typing as usual
vim.keymap.set("i", ", ", ", ", { desc = "Comma space" })
vim.keymap.set("i", ",<CR>", ",<CR>", { desc = "Comma enter" })
vim.keymap.set("i", ",,", ",,", { desc = "Comma comma" })

-- now special things
vim.keymap.set("i", ",m", "/", { desc = ",m type /" })
vim.keymap.set("i", ",a", "''<Esc>i", { desc = "single quotes" })
vim.keymap.set("i", ",s", '""<Esc>i', { desc = "double quotes" })
vim.keymap.set("i", ",d", "()<Esc>i", { desc = "parens" })
vim.keymap.set("i", ",f", "[]<Esc>i", { desc = "brackets" })
vim.keymap.set("i", ",g", "{}<Esc>i", { desc = "curlies" })
vim.keymap.set("i", ",r", "||<Esc>i", { desc = "pipes" })
1 Like

3 Likes