If you want to copy all text in a file using Vi/Vim console-based text editor, you can make use of the following command
For Vim Editor
- Open file using vim editor.
- Now make sure you are not in insert mode.
- Enter the text ggVG
- gg: To move the cursor at the first line of the file.
- V: To enter visual mode.
- G: To move the cursor at the last line of the file.
For Vi Editor
- Open file using Vi editor.
- Now make sure you are not in insert mode.
- Enter the text %y
- %: To select the text of the entire file.
- y: To copy the selected text into the buffer.
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to vi,
- How to add Colors to VIM (syntax highlighting)
- How to perform Find and Replace using vim Editor
- How to update VIM version on a Mac
- How to Select All Text in Vim/Vi editor
- Guide: Install Vim on Mac
- The Vim (vi) Mac Configuration File Details
- Fix :wq! Vi Error - E32: No file name (when write and quit)
- How to Copy all text to Clipboard in Vim
- How to Uninstall Vim on Mac?
More Posts:
- Pure JavaScript Digital Clock Widget to get GMT/UTC Time Now - JavaScript
- [Java] NoClassDefFoundError Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory - Java
- Stop android adb service from command prompt or terminal - Android
- How to Split on String in Java with Regular Expressions by Dot. - Java
- Get the Complete Sha256 Container ID for Docker Run Command - Docker
- Nano Show Line Numbers - Linux
- Online Free Notepad App - Tools
- npm WARN saveError ENOENT: no such file or directory, open /mnt/c/package.json - JavaScript