TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why Vim Uses hjkl & Why JavaScript months start from 0

4 pointsby dsr12about 4 years ago

1 comment

zzo38computerabout 4 years ago
Vim supports arrow keys as well as hjkl (although the original vi only uses hjkl; it was designed for use with a keyboard that does not have separate arrows).<p>I knew the things listed here, although not all of the details they mention. For the months, I would have used 1 for January (due to the convention in most things), but otherwise implement the code in a similar way to what they have there, effectively using 3 less than the string address as the base offset; in assembly language (and in an optimizing C compiler) this would be equally efficient to the code that they have.<p>(Also, the arrows in Dance Dance Revolution are also in this order; I don&#x27;t know if that is just a coincidence though. It does mean that an implementation using a computer keyboard could allow keys HJKL to be used, and it is easily understandable.)