Why Vim?
Or more specifically, Vim Motions.
One of the primary goals of Vim is to reduce finger travel distance.
Instead of using arrow keys, which are very far from the home row,
We use the H, J, K, and L, keys.
If you're confused about why that wouldn't just enter the letters
H, J, K, or L, we'll cover that soon!
But first, a quick game. Rest yourindex fingeron the H key.
I'll highlight a random key, and you need to enter it.
Score: 0 | Max Score: 0
const enforceCoordBounds = (newCoords: CursorCoords) => { if (newCoords.x < 0) newCoords.x = 0; if (newCoords.y < 0) newCoords.y = 0; const currentLineLength = (chars[newCoords.y] ?? chars[chars.length - 1]).length; const hasChangedY = (newCoords.y - cursorCoords.y) != 0; if (hasChangedY) { newCoords.x = furthestX; } if (newCoords.x > furthestX) setFurthestX(newCoords.x); if (newCoords.x > currentLineLength - 1) newCoords.x = currentLineLength - 1; if (newCoords.y > chars.length - 1) newCoords.y = chars.length - 1; return newCoords; };