Why do vim and less have such similar keybindings?

7,062

Short answer, common historical roots in vi. Their creators were both users of an earlier Unix program, vi.

Here is a rough diagram to put their initial release dates and influence in perspective:

vi 1976
 | \      more 1978
 |  \     /
 |   \   /
 |     v
 |   less 1983
 v
vim 1991

Sources:

Vim

Vim, by Bram Moolenaar, is a clone of the Unix program vi. From within vim you can look at the help intro: :help intro, you see:

Vim is a text editor which includes almost all the commands from the Unix program "Vi" and ...

Less

Whereas the creator of less, Mark Nudelman explains on his FAQ:

Back in 1983, I was working for a now-defunct company called Integrated Office Systems. Some of our software ran on a Unix system and produced enormous log files of its transactions. We wanted to be able to search these log files for error messages. But the version of "vi" we were using couldn't handle files larger than a certain size, and our log files often exceeded that size. So we were forced to use "more" to view the files. The problem was, once we found an error message, what we really wanted to see was the transactions leading up to the error; that is, the lines in the log file immediately before the error message. But more didn't allow backward movement in the file.

So he was already using vi and more when he created less to overcome the limitations of both vi and more at that time.

When you do man less, you see the connection to vi:

Commands are based on both more and vi.

Vim and Less

So less and vim seem to coincidentally have commands similar to each other, only because, those commands are actually based on vi, which can be seen as their common ancestor.

Share:
7,062

Related videos on Youtube

Peret Finctor
Author by

Peret Finctor

Updated on September 18, 2022

Comments

  • Peret Finctor
    Peret Finctor over 1 year

    Do they share code, or is that just a tradition? Are there any other programs with similar keybindings?

  • Sergiy Kolodyazhnyy
    Sergiy Kolodyazhnyy over 8 years
    I suspected they have similar roots but how about authors ? Are the vi and less authors the same ?
  • Spyros Mourelatos
    Spyros Mourelatos about 3 years
    Also an addition to this: Because these small family of tools became quite popular and pretty much the standards on a linux ecosystem more and more programs start turning these bindings in a tradition as they were well known to the community here is a big list of vim inspired appplications