Docs / Linux Basics / How to Use the vim Text Editor

How to Use the vim Text Editor

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 214 views · 1 min read

vim is a powerful text editor preferred by experienced Linux users.

Open a File

vim filename.txt

Modes

  • Normal mode — default mode for navigation and commands
  • Insert mode — press i to enter, type text
  • Command mode — press : for commands

Essential Commands

i          # Enter insert mode
Esc        # Return to normal mode
:w         # Save
:q         # Quit
:wq        # Save and quit
:q!        # Quit without saving
dd         # Delete line
yy         # Copy line
p          # Paste
u          # Undo
/search    # Search for text
n          # Next search result

Quick Edit and Save

The fastest workflow: vim filei → make changes → Esc:wq

Was this article helpful?