86 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 ...
nobe4's user avatar
  • 16.1k
28 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 ...
DJMcMayhem's user avatar
  • 17.6k
21 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 ...
Herb's user avatar
  • 1,213
21 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 ...
user3224237's user avatar
19 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 ...
Random832's user avatar
  • 1,222
15 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 ...
jamessan's user avatar
  • 11.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 ...
Sato Katsura's user avatar
  • 4,009
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 (...
Matt's user avatar
  • 20.7k
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 ...
Rich's user avatar
  • 32k
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 ...
D. Ben Knoble's user avatar
  • 26.2k
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. ...
Sato Katsura's user avatar
  • 4,009
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 ...
Tumbler41's user avatar
  • 7,746
5 votes
Accepted

Why did vi use hjkl instead of jikl?

Yes, the answer you link to is 100% accurate. I didn't go further because I didn't think it was particularly relevant. Vi uses HJKL for reasons outside of its creator's control. He didn't "choose&...
romainl's user avatar
  • 40.7k
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 ...
Mass's user avatar
  • 14.1k
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 ...
B Layer's user avatar
  • 19.9k
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}. ...
Maxim Kim's user avatar
  • 13.4k
5 votes

What is the relation between vi, nvi and vim?

The roots of the family trees of vi clones seem to be: 1977: "Traditional vi", Bill Joy's original source, ported and free to use since 2002. 1985: microEmacs, from which the vi-alike "...
martinwguy's user avatar
4 votes
Accepted

Does Vim have a marketing symbol?

Yes. Thanks Tumbler41 for the link.
nobe4's user avatar
  • 16.1k
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, ...
Warren Young's user avatar
3 votes
Accepted

Why is `vmap` for both Visual *and* Select mode?

At the time we (maintainers of snippet/template engines) had mappings using :vmap which were targetting the select mode. I still have a few traces of that in my lh-brackets plugin. Also the mswin.vim ...
Luc Hermitte's user avatar
  • 17.4k
2 votes
Accepted

Why is it okay to have a space in a `let` statement?

:set-args E487 E521 :se[t] {option}={value} or :se[t] {option}:{value} Set string or number option to {value}. For numeric options the value can ...
laktak's user avatar
  • 2,943
2 votes
Accepted

How to find patch release date

Conventionally, Bram tags every numbered patch of vim with a tag of the form v{patch_num}. If you have access to a local clone of the vim repository (https://github.com/vim/vim), the release date can ...
Mass's user avatar
  • 14.1k
1 vote

How to find patch release date

Patch 7.4.1154, that introduces jsonencode() and jsondecode() (also constants v:true, v:false, v:null and v:none), was introduced in commit 520e1e41f35b063 from January 23rd, 2016. Vim development ...
filbranden's user avatar
  • 28.8k
1 vote

Is there a reason why the short for `'modifiable'` is `'ma'` and not `'mo'`?

It is probably because there are two similarly-named options: 'modifiable' (shortened to 'ma') and 'modified' (shortened to 'mod').
Andrew Ho-Lee's user avatar
1 vote

Vi and Vim default to split left and split above. What is the history and motivation behind this?

This is interesting question. To me this is more of intuition. When I am looking onto the screen and reading, my cursor is at a specific point. Now, I want to open something. It would be best to open ...
mangupt's user avatar
  • 111
1 vote

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

The origin of the asymmetry goes back a ways into computing history. Short version: <CR> & <LF> (Carriage-Return and Linefeed) == \r & \n Long version: The first screens ...
Robin's user avatar
  • 121
1 vote

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

Other Vi clones do not support \r or \n (as a real backslash and letter) in substitution, but the behaviour of a real ^M (CTRL-V Enter) meaning to split the line into two lines is standard behavior: ...
Random832's user avatar
  • 1,222
1 vote

Why is the expression register "read only"?

The expression register expects an expression. yf4 is not an expression so there's no reason to expect the expression register to make any sense of it. If you want to use what you just yanked as an ...
romainl's user avatar
  • 40.7k
1 vote

Why is ] used for tag navigation?

I can't speak to the history of the command, but I think of [ and ] as previous and next. It's used for many motions. See help various-motions for several examples of square bracket motions. ...
ddrscott's user avatar
  • 431
1 vote

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

One practical use in one function. In the bellow function the python comment # is added and removed depending on the result of getline('.')[0]. If the line has a comment the char # is deleted, but in ...
SergioAraujo's user avatar
  • 1,175

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