Text editors

Swati VermaSwati Verma
2 min read

1. vi (or vim) Editor

  • vi (short for "Visual Editor") is a powerful and efficient text editor included in almost all Unix-based systems.

  • vim (Vi IMproved) is an enhanced version of vi with extra features like syntax highlighting and undo/redo.

  • Best for: Advanced users, programmers, and system administrators

Modes in vi/vim:

  • Normal Mode (default) – For navigation and commands

  • Insert Mode (i) – For text editing

  • Command Mode (:) – For running commands

Basic vi Commands:

  • Open a file:

      vi filename.txt
    
  • Enter Insert Mode: Press i

  • Escape out of any mode: esc

  • Save and exit: Press ESC, then :wq

  • Save changes: Press ESC, then :w and Enter

  • Exit vim: Press ESC, then :q and Enter

  • Exit without saving: Press ESC, then :q!

  • Forward search: /

  • Backward search: ?

  • Delete a line: dd

  • Copy a line: yy

  • Paste a line: p


Nano Editor

  • Nano is a beginner-friendly text editor with a simple interface.

  • Unlike vi, it does not have different modes—everything is done directly in the editor.

  • Best for: Beginners and quick edits

Basic nano Commands:

  • Open a file:

      nano filename.txt
    
  • Save changes: CTRL + O, then press Enter

  • Exit nano: CTRL + X

  • Cut a line: CTRL + K

  • Paste a line: CTRL + U

  • Search text: CTRL + W, type text, and press Enter


0
Subscribe to my newsletter

Read articles from Swati Verma directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Swati Verma
Swati Verma

Growing in DevOps, together! 🤝 | Associate Software Engineer at Tech Mahindra | Enthusiastic about automation, cloud solutions, and efficient software delivery. | Let's connect, collaborate, and learn from each other!