10

Why is the vi editor's copy command called “yank”?

Is there any thing significant that can help me to remember the command name?

  • 3
    Yank is a synonym for pull; you are pulling text to the clipboard... As to why it was called that, p was already taken... – jasonwryan Jun 14 '15 at 22:53
  • 2
    @Seth I have no reference to back that up... – jasonwryan Jun 15 '15 at 0:37
  • 1
    @jasonwryan, and I doubt you'll find a reference unless you ask Bill Joy! There is a certain type of question on the topic of history where there doesn't exist any reference except the whim of some long-ago programmer, and this is one of them. So you might as well just post the answer because it's the best we're gonna get. – Celada Jun 15 '15 at 0:57
  • When I first learned vi, I thought that "yank" was named after the identically named command in TECO. TECO's "yank" read the next page of the input file into the text buffer—not exactly the same as what y does in vi, but similar. I don't really know if it influenced Bill Joy or not, though. – Ben Kovitz Jun 15 '15 at 4:58
  • BTW, there is an entire StackExchange just for vi. Should this question be migrated there? – Ben Kovitz Jun 15 '15 at 5:06
9

Yank is a synonym for pull: it captures the concept of pulling text to the buffer or clipboard for later use.

As to why Bill Joy chose to use this term, I can only speculate that as p was already in use (an abbreviation for put) he wanted an mnemonic that was a single letter (as per the design of vi's progenitor, ed and then ex ) and evocative of the operation.

  • 1
    @user2196728 No, yank means to pull: I can't see why it would mean anything else, especially something that has no relationship to the actual operation... – jasonwryan Jun 15 '15 at 2:18
  • 4
    As yet another item in the great Emacs vs. vi confilct, Emacs calls its paste comand "yank". – cjm Jun 15 '15 at 3:09
  • 2
    @cjm another "UX Hall of Fame" moment for the OS that lacks only a decent editor... – jasonwryan Jun 15 '15 at 4:15
  • 1
    @MarkPlotnick No, not at all: I am saying that Joy couldn't have both pull and put bound to p. – jasonwryan Jun 15 '15 at 9:13
  • 4
    Emacs version 1, which was written about the same time as vi, already used kill/yank, which it inherited from TECO. TECO dates back to 1962 but I don't know if the first version already had these commands. I found PDP-8 manuals mentioning the yank command, but they may not be the original PDP-8. Nonetheless it seems that “yank” meaning “paste” (the word chosen at Xerox in the mid-1970s, which became the standard when ordinary people got GUIs) was already a thing by the time Joy wrote vi. – Gilles Jun 15 '15 at 22:47

Your Answer

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