lckdscl's site

Keybinding discoveries in Neovim

July 24, 2021

Updated on 24/08/2021

Current experience & self-promises

Originally, I wanted to make a custom cheatsheet with all my neovim bindings, but that would be a lot of work since I have many plugins with their own defaults, so I thought maybe I should spend the time doing actual productive work. Well, I stuck to this pattern after all, the best way to maintain a good ecosystem that caters to my own personal use is to let it evolve as you continuously use it, and of course, the most important thing, discovering new things.

For example, after constantly forcing myself to look up different ways to navigate a file without going jjj or kkkk or whatever repetitive motions you would normally do, I’m a much better vim user now. I still occasionally reach for the mouse, and I know there are plugins like hop or lightspeed that could rectify this, but here’s a hot take, it’s faster if I just move my damn mouse in those moments of fumbling. If I have enough vim-fu power at the time, I would’ve done a search for the keyword I want to jump to, or do :<line number>, which doesn’t take much brain juice at all. I also learned paragraph motions, like vip and text-object motions, like ci{, and in-line motions such as e, b, f, t, and their upper case variants.

The leader key crisis

I assigned ; to : a while ago, but my pinky didn’t appreciate it, so I moved to <space>. But what about the leader key? At first it was actually <space>, but it was too clunky, then it was <comma>, or <period>, or back to the default backslash. Then I settled on comma. It was more ergonomic than the period key, and definitely a lot more comfortable than the backslash. I also used ,. as leader for a while, but I realised I use leader quite frequently and it wasn’t working out.

Escape from Insert

While I have remapped in QMK the escape key to the Caps Lock key, since I don’t use Caps Lock at all, I also want a different way to hit escape, because with Caps Lock, my pinky is still working hard. The solution was to remap in insert jk, but this means if I want to type j, there’s a delay because vim wants to wait if I execute k in a time defined by timeoutlen. But fortunately, I found a plugin called Better Escape and while it is not written in Lua, but good ol’ vimscript, it works beautifully.

Recently learned things

Going forward

Obviously, I won’t be updating this if I learn new things, I found momentary bliss when I discovered these keybindings that is a boost to my QOL. While I might not be doing a lot of editing since it’s University summer break. I know I will be spending a lot of time on it when the semester starts. There are many good tutorials and blogs that go in depth into Vimscript and niche Vim bindings, but there is a beauty in letting problems arise, getting frustrated and finding or putting together an elegant solution (usually in the form of macros). It might not be a painless path, but the satisfaction and speed is definitely worth it.


Link on Github and alternatively, Codeberg