Vi/Vim is the most popular text editor for all Linux and Unix-based distributions.
Unfortunately, Ctrl+A keyboard shortcut does not work with vim, If you want to select all the text in a file you have opened on vi editors follow the below steps,
- Press the g button twice: gg - this will take the cursor to the start of the file.
- Now Press Shift + v to move to visual mode.
- Now Press Shift + g to move the end of the last line of the file.
> gg Shift+v Shift+g
You can also use :1 instead of gg
:1 Shift+v followed by Shift+g
You can download this article in various formats for your convenience. Choose from the options below:
Facing issues? Have Questions? Post them here! I am happy to answer!
- ls Command to See Hidden Files
- List of Special Parameters/Variables in Bash Shell Scripting
- How to check file permissions for your file using Linux/Unix/macOS Terminal Command
- How to Exit a File in Terminal (Bash/Zsh)
- Sort ls command by last modified date and time
- How to Reboot a Linux Server?
- Shortcut: How to delete a complete line in Nano Editor
- How to backup a file in Linux/Unix
- Copy entire directory using Terminal Command [Linux, Mac, Bash]
- Create Hidden File or Directory using Shell Command
- How to Display content of a file in Terminal Screen?
- How to check uptime of Linux/Unix/macOS system/server using console command?
- ls command: sort files by name alphabetically A-Z or Z-A [Linux/Unix/macOS/Bash]
- How to Save and Exit a File in Nano [macOS/Linux/Ubuntu] Terminal
- How to save a file in Nano Editor and Exit
- How to install npm on Ubuntu
- How to create tar.gz file using Terminal Command
- How to Change Background/Foreground Color to Vim
- Linux Remove or Delete Files and Directories using Terminal Commands
- Linux: Create a New User and Password and Login Example
- What is the Difference Between $SHELL and $0 Environment Variables?
- Check SSH/OpenSSH version Command
- How to remove/delete a directory in Linux/macOs
- How to create a Symbolic Link in Linux (ln -s)
- Command to check Last Login or Reboot History of Users and TTYs
- java: ']' expected error [fixed] - Java
- Sign in as different user missing in SharePoint 2013 how to enable - SharePoint
- The Quick Analysis Tool in Excel for Mac? - MacOS
- Read file from resources folder in Java project code - Java
- Error running 'app': No target device found. - Android-Studio
- List of PowerShell Cmdlet Commands for Mac - Powershell
- Fix - cd: no such file or directory: .zshrc - zsh
- pwd Command - Print Working Directory - Linux