Mar 23, 2023 2 min read

Vim editor command

Vim editor command
Supercharge productivity with Vim terminal editor 
Table of Contents

Vim is a text editor that is widely used in the Linux/Unix environment.

Here are some basic commands that you can use in Vim:

To open a file in Vim

vim <file_name>

To switch between normal mode and insert mode

  • Press i to enter insert mode, which allows you to type in the text.
  • Press Esc to return to normal mode.

To save changes and exit Vim

  • Press Esc to return to normal mode
  • Type :w to save changes
  • Type :q to exit Vim
  • If you have made changes and want to save and exit at the same time, type :wq

To move the cursor

Use the arrow keys to move the cursor up, down, left, or right

  • Or use the following keys to move more quickly:
  • h to move left
  • j to move down
  • k to move up
  • l to move right

To delete text

  • Position the cursor over the text you want to delete.
  • Press x to delete the character under the cursor.
  • Press dd to delete the entire line.

To copy and paste text

Position the cursor over the text you want to copy

  • Press yy to copy the entire line.
  • Position the cursor where you want to paste the text.
  • Press p to paste the copied text after the cursor, or P to paste before the cursor.

To search for text

Press / to enter search mode

  • Type the text you want to search for, and press Enter
  • Press n to move to the next occurrence of the search term, or N to move to the previous occurrence.

These are just a few basic commands to get you started. Vim has many more commands and features that you can learn as you become more familiar with the editor.

For More Command Check below Cheat Sheet.

Vim editor cheat sheet

Download the Above Cheat Sheet Image by Link

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to BugFix.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.