yy VIM Command

How to use yy Command in Linux VIM editor?

Explanation


yy stands for Yank Current Line
This command is used to copy the current line from the file to clipboard. The copied line can be pasted at required position.

Usage:

yy

Example:

  • Open the file test.txt using the command
    $ vim test.txt
  • We can notice the text in the file.
    Hiox India
    Vim Tutorial

  • Move the cursor to the second line, which we have to copy.
  • Copy the line to clipboard using the Yank command
    Press yy
  • Using put command we can paste the copied content
    Press p
  • The copied content will be pasted
    yy Vim Command

Ask Questions

Ask Question