yG VIM Command

How to use yG Command in Linux VIM editor?


yG stands for Yank Group
This command is used to copy the text from current line to end of the file.




Steps to copy text from the file using the vim editor.
  • Open the file test.txt using the command
    $ vim test.txt
  • We can notice the text in the file.
    Hiox India
    Vim Tutorial
    Line 1
    Line 2
    Line 3

  • Let us see how to copy the text from 'Line 1' to end of the file.
  • Move the cursor to the 'Line 1'
  • To copy the lines to clipboard
    Press yG
  • Using put command we can paste the copied content
    Press p
  • The copied content will be pasted
    yG (Yank Group) Vim Command

Ask Questions

Ask Question