vi Editor

vi Editor क्या है?

vi एक text editor है जो Linux/UNIX में files को create, edit और manage करने के लिए use होता है।

मतलब:
Terminal के अंदर text files को edit करने के लिए vi editor का उपयोग किया जाता है।

Basic Concept

  • Command-based editor है
  • Mouse की जरूरत नहीं होती
  • Keyboard से control होता है
  • Multiple modes में काम करता है

Startup and Modes

vi Editor Start करना

vi filename.txt

अगर file exist नहीं करती → नई file create हो जाएगी

Modes of vi Editor

1. Command Mode

  • Default mode होता है
  • इसमें commands execute होती हैं

2. Insert Mode

  • Text लिखने के लिए use होता है

Insert mode में जाने के लिए:

i

3. Last Line Mode (Escape Mode)

  • Commands जैसे save, exit आदि के लिए

Enter करने के लिए:

Esc + :

Creating & Editing Files

File Create करना

vi file.txt

Text लिखना

  • Insert mode में जाओ (i दबाओ)
  • Text लिखो

Save करना

:w

Exit करना

:q

Save + Exit

:wq

बिना save exit

:q!

Insertion & Deletion

Insertion Commands

i   → cursor के पहले insert  
a → cursor के बाद insert
o → नई line नीचे

Deletion Commands

x    → character delete  
dd → पूरी line delete
d$ → line के end तक delete

Searching Operations

Search करना

/word

Next match:

n

Previous match:

N

Yank, Put, Delete Commands

Yank (Copy)

yy   → line copy  
y$ → line का हिस्सा copy

Put (Paste)

p

Delete

dd   → line delete  
x → character delete

vim (Improved vi)

vim क्या है?

vim (Vi IMproved) vi editor का advanced version है।

Features of vim

  • Syntax highlighting
  • Better UI
  • Undo/Redo support
  • Multi-level editing

vim Start करना

vim file.txt

Difference between vi and vim

vi:

  • Basic editor
  • Limited features

vim:

  • Advanced editor
  • ज्यादा सुविधाएँ

Short Conclusion (Exam Ready)

vi Editor एक command-based text editor है जिसका उपयोग Linux/UNIX में files को create और edit करने के लिए किया जाता है। इसमें command mode, insert mode और last line mode होते हैं। vim इसका improved version है जिसमें advanced features होते हैं।

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top