Several of the commands for browsing programs with tags use ].
- Is there a mnemonic for this?
- Why was it selected?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communitySeveral of the commands for browsing programs with tags use ].
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, such as Ctrl-L (form feed), which vi
reinterprets from "form feed" to mean "repaint display" instead, that being more appropriate to a text editor.
Commands like "jump to tag" — Ctrl-] — need to be usable in insert mode as well as command mode, so it couldn't use one of the printable ASCII characters. ASCII defines only 32 non-printable characters. Of those left, Ctrl-] apparently seemed like the best choice.
These standards go back something like 15 years before vi
was created, so vi
had to play within the existing landscape. You can imagine that all the good ones were taken by the time vi
came on the scene.
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.
Therefore, <C-]>
becomes "Control-Next".
help CTRL-]
describes it as "Jump to the definition". When I'm pairing that's a bit long winded, so I usually say "drill down" instead.
^]
, they say:Mnemonically, this command is ''go right to'' (7.3).
– saginaw Dec 21 '15 at 20:06^]
, but only:ta
. I'm going to tag this withoriginal-vi
, Vim's earliest version I could find (1.4) had this in 1991, so presumably it's avi
thing. – muru Dec 22 '15 at 3:42