Vim

getting rid of that mouse

Created: | 337 words | 2 minutes

Vim is an old CLI1 text editor that is designed to handle all of the basic editing functionality without requiring arrow keys or mouse pointer (back in the day computer mice didn’t even exist).

Modes and keybindings

When you open a file in Vim, the editor is opened in NORMAL mode. That means most of the keyboard keys are binded to main actions:

h, j, k, l for left, down, up and right navigation respectively

r to replace a single character, u for undo, y to yank (copy) selection

Other keybinds like “move to middle of the screen” or “transpose 2 letters” can and should be read from any Vim cheatsheet. No one knows how to exit Vim though.

When you put a cursor on a place you’d like to edit, you can press i to enter INSERT mode, where your keyboard will act as a text input device. Pressing Esc2 will get you back to NORMAL mode used for navigation and quick edits.

Arrow keys can still be used in both modes for jumping between lines and characters, though doing so in Vim is considered cringe cuz the sole purpose of the editor is to keep user’s wrist fixed on the middle of the keyboard and not leaving the home row.

Use cases

As for me, I use these binds just to look cool. But they do in fact speed up the navigation and feel more ergonomic in general. Once you master Vim keybinds (which is not so ez), it gets easier to use any DM, CLI file manager and even browser - see Tridactyl (firefox only) and Vimium extensions.

As for the text editor itself, I use NvChad - a pretty nvim config written in lua

nvchad
nvchad

Footnotes


  1. Technically there is a GUI app, tho I won’t believe a single person is using it with a serious face. ↩︎

  2. I’ve mapped Esc to Capslock in my desktop manager settings cuz the latter is much easier to access, plus Capslock is rarely used for its intended purpose. ↩︎