More

    How copy all the content of a file in Vim to clipboard

    To copy all the content of a file in Vim to the clipboard, you can use the following command:

    :%y+
    
    

     

    Press ESC key to quit  from insert mode to normal mode,  then press : to type in the command above(%y+).

    Basically, this command yanks (copies) all the lines in the file to the system clipboard. The  % symbol indicates that you want to operate on all lines, and y letter is the yank command. The +  sign tells Vim to use the system clipboard.

    See also:

    1. How to Schedule Recurring User Jobs using Cronie in Linux

    Recent Articles

    Related Articles

    Leave A Reply

    Please enter your comment!
    Please enter your name here