In the texteditor vim, people use the y-key to copy something, it stands for yank.
I am curious: Why can yank have the meaning of copy?

  • 5
    Yank doesn't mean "copy" outside this context. It just happened to begin with the letter Y, and more appropriate letters like C were already taken, so Bill Joy chose to pound a square peg into a round hole. – snailcar Dec 19 '13 at 13:51
  • 1
    i"Yank" does mean "copy"<Esc>4bwinot <Esc>A. – Damkerng T. Dec 19 '13 at 13:56
  • 4
    Anyway I think the use of "yank" in Vim is an apt one. I always think of it as yanking the text from its original place and putting it into Vim's buffer. – Damkerng T. Dec 19 '13 at 14:17
  • 1
    This question appears to be off-topic because it is about the (tenuous) rationale for assigning a particular function to a particular letter. It's about as meaningless as the idea that because Ctrl+C = Copy, in Ctrl+V the V stands for Latin word vipectus{paste} – FumbleFingers Reinstate Monica Dec 19 '13 at 17:00

The word simply means to pull. Data is being pulled from the buffer into a register: either the default one, or a named one.

Physical movement metaphors, or even onomatopoeia, are used in computing for denoting data transfer. We push onto a stack and pull or pop from it. We load data or store it. We move from one location to another. All of these data movements are in fact a copy operation. Yank doesn't mean copy any more than do push, pull, pop, load, store, extract, retrieve, fetch, return, check out, and others. We know them to denote copying because of the context of data transfer. We know that when we "check out" something from a repository, we end up with a working copy, while the repository remains intact; yet "check out" (a library book, or from a hotel) doesn't mean "to copy".

Vi's designer probably assigned an unused letter to the operation, and then searched through possible words for a mnemonic to go with that letter: a word that denotes data extraction or transfer.

You can expect to find "yank" as a synonym of "pull" in any decent thesaurus. The "extract (verb)" entry on thesaurus.com lists "yank", so if you're looking for a word denoting data extraction that starts with Y, you don't have to look very hard.

|improve this answer|||||
  • Stuff sometimes gets funny names in computing. Why is that pointing tool called a mouse? Or a group of bits a byte, half of which is a nybble? – Kaz Dec 19 '13 at 22:27
  • Years ago I used the temporary variable name sausage to denote a record of data represented as a single character string, in which the fields are separated by the | symbol. A lot of the data was counters from telephone switches representing quantities like number of lines in use. At the time, someone on the team called such strings "sausages" (from "linked sausage"). Weeks later, we received a question from a customer, who wanted to know what kind of usage is "s. a. usage", whereupon we had to embarrassingly explain the reference. – Kaz Dec 19 '13 at 22:27

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