85 votes
Accepted

Why does vim use hjkl for cursor keys?

From http://www.catonmat.net/blog/why-vim-uses-hjkl-as-arrow-keys/: When Bill Joy created the vi text editor he used the ADM-3A terminal, which had the arrows on hjkl keys. Naturally he reused the ...
user avatar
  • 15.2k
51 votes

How much money has been raised for needy children in Uganda from Vim?

tl;dr: as of 2020, it would seem that about €1.35 million ($1.63 million USD) has been raised. ICCF & Vim seem very intertwined, and probably a majority of the donations came from Vim users, but ...
user avatar
38 votes
Accepted

What is the select mode and when is it relevant to use it?

The whole point of select mode is to provide a selection behavior similar to the one used in conventional editors. On the same note, there's mswin.vim which changes a bunch of options and mappings to ...
user avatar
  • 33.1k
34 votes
Accepted

What is the correct capitalization of 'vim'?

This actually took quite some searching, but the correct way is 'Vim'. From :help pronounce: Vim is pronounced as one word, like Jim, not vi-ai-em. It's written with a capital, since it's a name, ...
user avatar
27 votes
Accepted

What is the relation between vi, nvi and vim?

From nvi(1): HISTORY The ex editor first appeared in 1BSD. The nex/nvi replacements for the ex/vi editor first appeared in 4.4BSD. Some background, from memory, so I hope got the details ...
user avatar
26 votes

Why does vim use hjkl for cursor keys?

Nobe4's answer is great, and explains why we use hjkl very well. However, it's really interesting to see the full keyboard, and a lot of strange things about vim make more sense when you can see the ...
user avatar
  • 16.8k
20 votes
Accepted

Why is it called a "vimrc" file?

The Unix section of the wiki page on configuration files, leads to the wiki page on run commands, which is where the rc comes from. Quoting from the run commands page: In the context of Unix-like ...
user avatar
  • 1,193
19 votes
Accepted

Why is Y a synonym for yy instead of y$?

I found a paper "An Introduction to Display Editing with Vi" by William Joy (vi creator) and Mark Horton (vi maintainer since 1979). From the paper it is clear that the default Y behavior is not a ...
user avatar
18 votes
Accepted

What is the use of the black hole register ("_)?

The black hole register is used in the same situations as /dev/null: when you do an action that normally outputs something but you have no use for that output. Vim's default behavior is to "cut", not ...
user avatar
  • 33.1k
18 votes

Why is Y a synonym for yy instead of y$?

Y was the yank command of the first vi version (ex-1.1, January 1, 1978). This version did not have the yy cammand. ex-2.2 (May 6, 1979) did have both yy and Y. So actually yy is a synonym for Y (Y ...
user avatar
17 votes

Why does vim use hjkl for cursor keys?

As to why these arrows were printed on these keys... it's because they could be used with the control key for local cursor movement. Ctrl-H and Ctrl-J (backspace and line feed) are obvious, and an ...
user avatar
  • 1,172
14 votes
Accepted

What is the rationale for \r and \n meaning different things in s command?

At the most basic level, there's already an asymmetry between the search and replace portions of :substitute because the former is a regular expression and the latter is text, with specific additional ...
user avatar
  • 10.4k
13 votes

Does Vimscript have an official name?

The name VimL appeared in the documentation in July 2013. Vim's scripting language didn't have a name before that. VimL is the only name mentioned in the documentation. It doesn't really make it the ...
user avatar
  • 33.1k
11 votes

What are the advantages of using colon for commands instead of semicolon?

You know the story behind the hjkl keys in Vi? Well, : was unshifted on Vi author's ADM-3A terminal. No idea if that's the real explanation in this particular case, but it seems at least as ...
user avatar
  • 3,879
10 votes
Accepted

Advice to add `set nocompatible` as first line of .vimrc

Is there any advantages or side-effects of an explicit set nocompatible that I'm perhaps missing? Actually, there are many side-effects. Every time compatible is set or reset Vim rescans all options (...
user avatar
  • 16.9k
9 votes
Accepted

Why doesn't vimscript provide a random number generator?

Because the patches have been sitting in the TODO list for almost five years. Don't forget, vimscript wasn't designed: it is only the ever-changing interim result of a slow evolutionary process. Hell,...
user avatar
  • 33.1k
7 votes

Why doesn't vimscript provide a random number generator?

Well, generating random numbers isn't really the task of a an editor, IMHO. And with Vim, "the Unix way" to do it is to rely on other tools, that do it ... better. E.g. you can: on *nix systems, read ...
user avatar
  • 9,340
7 votes

Advice to add `set nocompatible` as first line of .vimrc

One reason you might want to include a guarded set nocompatible in your .vimrc is that compatible will not be automatically unset if you specify the vimrc with the -u flag: Using the "-u" argument ...
user avatar
  • 28.2k
7 votes
Accepted

When was getcharstr() introduced? And how could I have found the answer my self from :help?

This was patch v8.2.2957, which can be found by examining a full clone of github.com/vim/vim and any of # message search; fast enough I didn't need any of the other limiting options git log -1 --grep ...
user avatar
  • 21.5k
6 votes

What is the rationale for \r and \n meaning different things in s command?

A NUL byte is a string terminator in C, and for this reason Vim uses this convention, described in the manual at :h NL-used-for-Nul: <Nul> characters in the file are stored as <NL> in memory. ...
user avatar
  • 3,879
6 votes

Why is the visual selection represented by these characters: '<,'> ? Can it be parsed?

This is actually mark notation. Anytime you go into a visual selection the beginning of the selection is marked with the mark <, and the end with the mark >. You can also do ex-commands between ...
user avatar
  • 7,466
6 votes

What is the use of the black hole register ("_)?

Besides deleting text, you can use the black hole register to delete other registers. Example: :let @a=@_ This is one way of clearing register "a.
user avatar
  • 1,999
6 votes
Accepted

Did Vim ever use a different versioning scheme?

Yes, they were both caused by changes to the packaging and unrelated to Vim itself. The first epoch bump (since all packages without an explicit epoch have an implicit 0 epoch) was introduced when ...
user avatar
  • 10.4k
5 votes

Why are ^ and $ still magic in nomagic mode?

The nomagic setting was created to support the edit mode, which was "designed for more casual or beginning users", rather than as a general "nothing is a metacharacter" mode. From the ex reference ...
user avatar
  • 1,172
5 votes

Why doesn't vimscript provide a random number generator?

Vim has rand() function since 8.1.2342 rand([{expr}]) *rand()* *random* Return a pseudo-random Number generated with an xoshiro128** algorithm using seed {expr}. ...
user avatar
  • 10.4k
5 votes
Accepted

Traditional Vi and its regular expressions

It's always been my understanding that vi followed the POSIX standard (BRE/ERE). Given the far more tight-knit technical community/ecosystem of the time I think he would have to have been a bit mad to ...
user avatar
  • 18.4k
5 votes
Accepted

Why does vi sometimes use harder-to-reach keys?

Bill Joy (the original author of vi) explains this in An Introduction to Display Editing with Vi. The [[ and ]] operations require the operation character to be doubled because they can move the ...
user avatar
  • 12.8k
4 votes
Accepted

Does Vim have a marketing symbol?

Yes. Thanks Tumbler41 for the link.
user avatar
  • 15.2k
3 votes

Why is ] used for tag navigation?

vi was designed for use with glass terminals, the protocols of which often use many of the control-x commands down at the low end of ASCII. Others were reassigned in the move from paper terminals, ...
user avatar
3 votes

Why are ^ and $ still magic in nomagic mode?

Apparently magic/nomagic dates back to Ex (mentioned in the pdf user manual), but I'm not sure of the reasoning behind the original decision. If you're using Vim, there are 4 levels of 'magic' you can ...
user avatar
  • 2,868

Only top scored, non community-wiki answers of a minimum length are eligible