Home Interests Vim

Vim: How to Copy to Your System Clipboard

howchoo
howchoo   (456)
August 8, 2023
2 minutes

Share

Interests
Posted in these interests:

Vim

vim • 5 guides

If you find yourself highlighting text in Vim with your mouse to copy and paste it elsewhere, stop. There’s a better way, using the yank command, to copy text into your clipboard on macOS or Windows.

TL;DR

"*y

Use the yank command

You may be familiar with the yank command: y to copy selected text, yy to copy the current line. To copy to the system clipboard, we’ll use the same command with a few extras modifier to select the correct register.

Choosing a register

In Vim, you choose a register using ".

The system register

For both Mac and Windows, you can select the system register by using *.

Putting it all together

Enter visual mode by hitting v. Select the text you want to copy, then type:

"*y

Now go paste freely!

NEXT UP

How to Change or Switch the Case of Characters in Vim

howchoo
howchoo   (456)
September 18, 2023

Need to change the case of characters to all caps or all lowercase? This is easily done using Vim. This guide will show you how to change the case of characters in Vim. tl;dr Toggle “Hello” to “hELLO” with g~. Uppercase “Hello” to “HELLO” with gU. Lowercase “Hello” to “hello” with gu. 1 – Select the text you’re

Continue Reading

howchoo

 456 guides

Introducing Howchoo, an enigmatic author whose unique pen name reflects their boundless curiosity and limitless creativity. Mysterious and multifaceted, Howchoo has emerged as a captivating storyteller, leaving readers mesmerized by the uncharted realms they craft with their words. With an insatiable appetite for knowledge and a love for exploration, Howchoo's writing transcends conventional genres, blurring the lines between fantasy, science fiction, and the surreal. Their narratives are a kaleidoscope of ideas, weaving together intricate plots, unforgettable characters, and thought-provoking themes that challenge the boundaries of imagination.

Discover interesting things!

Explore Howchoo's most popular interests.

Explore