Vim
Vim is a text editor that has special keybinds and features that allows the user to edit text purely with the keyboard. This type of workflow increases typing efficiency since the user won’t need to reach for the mouse or touchpad to do a certain task that would normally require it. This also minimizes movement which is helpful for those with hand mobility issues.
The keybindings it uses are wildly different from the conventional keybinds so it takes a bit of time to get used to it. It is also highly recommended that the user learn how to touch type to make the learning process and general usage of Vim easier.
Touch typing is highly beneficial for keyboard users in general. It massively increases your typing speed compared to typing with random fingers while looking at the keyboard. Personally, touch typing helped me keep up with class lectures as I typed notes.
Touch typing is very easy to learn as it is easy to learn Vim. It’s only hard at the start. It took me about four days to build the muscle memory for the proper finger positions for touch typing. Meanwhile it took me two coding sessions under 12 hours to get used to the basic Vim keybindings.
I use Vim mode through an extension on VSCodium. There are many guides on it online. I personally reference this cheat sheet but here is one I’ve created on my own with descriptions that make the most sense to me. I’ve also remapped some of the keybindings to fit my own workflow.
Navigating
- [h, l] – move one character [left or right]
- [j, k] – move one line [down or up]
- remapped to [gj, gk] – move one line [down or up] with respect to line wrapping (strangely doesn't work properly in Visual mode)
- [w, e] – move to [beginning or end] of next word
- [b] – move to [beginning] of previous word
- [gE] ⟶ remapped to [n] – move to end of [previous] word
- [H, M, L] – move to [top, middle or bottom] of screen
- [gg, G] – move to [first or last] line
- [:#] – jump to line number #
- [:+#, :-#] – jump # lines [down or up]
- [/pattern] – search file for occurrences of “pattern”, moving forward
- [n, N] ⟶ remapped to [f, F] – move cursor to [next or previous] occurrence of “pattern”
- [Ctrl+c] or [Escape] – revert to Normal mode
Editing
- [u] – Undo
- [Ctrl+r] – Redo
- [x] – Cuts character after cursor
Editing in Visual mode
- [v] – start Visual mode (moving the cursor selects text)
- [V] – select line
- [y] – Copy selected text
- [yy] – Copy line
- [#yy] – Copy # number of lines below
- [yiw, yaw] – Copy word under cursor [excluding or including] the space before or after it
- [d] – Cut selected text
- [dd] – Cut line
- [#dd] – Cut # number of lines below
- [diw, daw] – Cut word under cursor [excluding or including] the space before or after it
- [p, P] – paste text [after or before] the cursor
- [gp, gP] – paste text [after or before] the cursor, then move cursor to end of new text
- [u, U] – transform selected text to [lowercase or uppercase]
Writing
Different ways to enter Insert mode
- [i, a] – Insert [before or after] the cursor
- [o, O] – Insert a new line [below or above] the cursor
- [ea] – Insert at end of a word
- [ciw] – replace word (deletes word under the cursor then enters Insert mode)
- [s] – replace single character (deletes character under the cursor then enters Insert mode)
- [S] or [cc] – replace line (deletes line under the cursor then enters Insert mode)
Editing in Insert mode
- [Ctrl+h] – Backspace key; delete character before cursor
- [Ctrl+W] – Ctrl+Backspace key; delete word before cursor
- [Ctrl+d, Ctrl+t] – indent [left or right]
Other commands
- [:w] – Save file
- [:x] – Save file then close tab
- [:q!] – close tab without Saving
- [:wqa] – Save file on all tabs then close all tabs
There are many more keybindings and features that I haven’t discovered yet but these are the ones I use the most.