Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Copy all the lines to clipboard

You should yank the text to the * or + registers:

gg"*yG

Explanation:

  • gg to get the cursor to the first character of the file
  • "*y to start a yank command to the register * from the first line, until…
  • G to go the end of the file

Related Posts:

  1. Where is my .vimrc file?
  2. How to make vim paste from (and copy to) system’s clipboard?
  3. How can I quickly delete a line in VIM starting at the cursor position?
  4. How to copy to clipboard in Vim?
  5. Vim Can’t Save File (E212)
  6. Move cursor to end of file in vim
  7. What is Vim recording and how can it be disabled?
  8. Backspace key not working in Vim/vi
  9. vim and notepad++
  10. vi/vim editor, copy a block (not usual action)
  11. How do I change tab size in Vim?
  12. How to go back (ctrl+z) in vi/vim
  13. How to do case insensitive search in Vim
  14. What’s a quick way to comment/uncomment lines in Vim?
  15. Vim clear last search highlighting
  16. What is the difference between the remap, noremap, nnoremap and vnoremap mapping commands in Vim?
  17. Changing case in Vim
Categories vim
Get Root Directory Path of a PHP project
How to map with index in Ruby?

Leave a Comment Cancel reply

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress