Copying and pasting with Vim and YankRing

Yank and Pull

Article from Issue 167/2014
Author(s):

With the YankRing plugin, Vim's yank and pull features become even more powerful.

You can tell that Vim is an old text editor by its use of "yank" for "copy" and "pull" for "paste." However, never let the obsolete terminology fool you – in many ways, Vim's yank and pull are still more sophisticated than anything you can find on most modern desktops. Add the YankRing plugin [1], and Vim's yank and pull capacities become even more powerful.

For some users, unenhanced Vim may be enough for their needs. Anything pulled or deleted is stored, the most recent first, in a register – Vim's name for the buffer that serves as a clipboard. A register can contain up to nine items, which you can view with the command :reg or :register. If one register is not enough, you can have up to 26, each identified by a single lowercase letter.

A register is specified by prefacing a command with its name, so that ayw copies a word and puts it in register a.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Between the Lines

    Readline provides you with a rich set of tools for working with text and moving around quickly and efficiently on the command line.

  • Programming Snapshot – Python Scripts

    Mike Schilli takes on the almost 2,000-year-old Chinese Rings puzzle. Instead of just jingling rings, he tries to find a solution with logical operators.

  • Ranger

    Ranger offers a wealth of commands – many with alternatives – and less reliance on a mouse.

  • Ring Secure Communication

    In the last few years, secure text, voice, and video transmission have become major areas of free software development. One of the leaders in this field is Ring.

  • VIM TRICKS

    You don’t have to use the vim text editor as a latter day vi. These simple tricks will save you time and keystrokes.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News