Home » VIM Editor : Useful Shortcuts
Linux

VIM Editor : Useful Shortcuts


Vim, the VI IMproved text editor, is one of the most widely used text editors in the industry. Individuals working in System Engineering, DevOps, and SRE domains frequently use this tool for their day-to-day needs.

In this article, I will include a few shortcuts that I use on a daily basis. These shortcuts help me save time and improve my efficiency when working with files.


Cursor Movement:
  • e – jump forwards to the end of a word
  • E – jump forwards to the end of a word
  • b – jump backwards to the start of a word
  • B – jump backwards to the start of a word
  • 0 – jump to the start of the line
  • ^ – jump to the first non-blank character of the line
  • $ – jump to the end of the line
  • gg – go to the first line of the document
  • G – go to the last line of the document

Inserting and Appending text:
  • i – insert before the cursor
  • I – insert at the beginning of the line
  • a – insert/append after the cursor
  • A – insert/append at the end of the line
  • o – append/open a new line below the current line
  • O – append/open a new line above the current line

Visual Mode shortcuts:
  • > – shift text right
  • < – shift text left
  • y – yank (copy) marked text
  • d – delete marked text
  • ~ – switch case
  • u – change marked text to lowercase
  • U – change marked text to uppercase

Search and Replace:
  • /pattern – search for pattern
  • ?pattern – search backward for pattern
  • n – repeat search in same direction
  • N – repeat search in opposite direction
  • :%s/old/new/g – replace all old with new throughout file

We hope this article is helpful. Please stay tuned for additional content.
Adios Amigo !

Add Comment

Click here to post a comment