1

For example:

  • [[ and ]] instead of [ and ], and
  • G instead of g.

Some ideas:

  • Vim used these keys first, and they were backported to Vi (though G seems like an essential command for a code editor)
  • Vi might have wanted to reserve them for prefix keys, as Vim did later (but why not v or q?)

I have both nvi and vi (from http://ex-vi.sourceforge.net/) on my computer (to check that this isn't some extension on a particular vi clone.)

4
  • Welcome to Vi and Vim! Not sure I see much problem with [[ and ]] (pressing the same key twice isn't that bad), but I kind of see the point with G... Not sure someone will know where this came from, but let's see, maybe yes.
    – filbranden
    Nov 26 '20 at 1:45
  • If Vim would use [then how would [s and all the other mappings that start with [ work? It would have to wait for a timeout, which has its own issues. Nov 26 '20 at 5:18
  • 1
    I'm surprised you didn't mention : to reach the command line while ; does almost nothing.
    – Quasímodo
    Nov 26 '20 at 11:13
  • 1
    @Quasímodo, on the keyboard vi was developed on : did not require pressing shift. upload.wikimedia.org/wikipedia/commons/a/a0/…. f/t/;/, is/was considered a useful set of motions to have easily accessible.
    – Mass
    Nov 26 '20 at 15:37
5

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 cursor far from where it currently is. While it is easy to get back with the command ``, these commands would still be frustrating if they were easy to hit accidentally.

I did not find a justification for G but I presume it is similar.

Generally speaking, in vi short movements (w, e, etc.) are lower-case and long movements are upper case (like H, L, M). Note that in vi, gg does not exist, and it was added by vim.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.