Skip to Content
Mastering Vim
book

Mastering Vim

by Ruslan Osipov
November 2018
Beginner
330 pages
7h 21m
English
Packt Publishing
Content preview from Mastering Vim

Copying from outside of Vim

There are two built-in registers that interact with the outside world:

  • The * register is the primary system clipboard (the default clipboard in Mac and Windows, and mouse selection inside a Terminal in Linux)
  • The + register (only in Linux) is used for Windows-style Ctrl + c and Ctrl + v operations (referred to as Clipboard selection)

You can interact with these registers as you would with any other. For instance, you can use "*p to paste from the primary clipboard or use "+yy to yank a line into Linux's Clipboard selection.

If you want Vim to work with these registers by default, you can set the clipboard variable in your .vimrc file. Set it to unnamed to copy and paste from the * register:

set clipboard=unnamed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Vim

Mastering Vim

Damian Conway
Vim Masterclass

Vim Masterclass

Jason Cannon
Modern Vim

Modern Vim

Drew Neil

Publisher Resources

ISBN: 9781789341096Supplemental Content