Help Save Code2care! 😢

I've lost 99% of my revenue to AdBlockers & AI. Your support could be the lifeline that keeps this passion project alive!

Buy Code2care a Coffee QR Code

Scan to Buy Me A Coffee and help me continue coding for you!

How to Select All text in vim/vi editor using Keyboard


Select All Text in Vi Vim Editor

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!

Author Info:

Rakesh (He/Him) has a Masters Degree in Computer Science with over 15+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright Code2care © 2024 | Privacy Policy | About Us | Contact Us | Search