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.
Have Questions? Post them here!
- Add Line Break in Microsoft Excel Cell on Mac (macOS) - MacOS
- [fix] Cannot connect to the Docker daemon at unix:var/run/docker.sock. Is the docker daemon running? - Docker
- Fix: Amazon Linux bash: sudo: command not found - AWS
- JDK Location in Android Studio - Android-Studio
- How to use SCP Command to Copy Directory - Linux
- Eclipse : Workspace was written with an older version of the product and will be updated - Eclipse
- Java JDBC Delete a Record in Database Table using PreparedStatement - Java
- Spotify is down for iOS and Android globally - error no internet connection available, something went wrong - News