VI editor

A comprehensive guide to using the VI/Vim text editor in Linux, from basic operations to advanced features.

🚀 Getting Started

Opening and Closing

# Starting VI
vi filename           # Open file in VI
vim filename         # Open file in VIM
view filename        # Open in read-only mode
vimdiff file1 file2  # Compare files

# Saving and Quitting
:w                   # Save changes
:q                   # Quit (if no changes)
:wq or :x            # Save and quit
:q!                  # Quit without saving
ZZ                   # Save and quit

📝 Basic Navigation

Moving the Cursor

Screen Navigation

✏️ Basic Editing

Inserting Text

Deleting Text

Copying and Pasting

🔄 Undo and Redo

History Operations

🔍 Search and Replace

Search Operations

Replace Operations

📋 Visual Mode

Visual Selection

Visual Operations

🎯 Advanced Navigation

Word Navigation

Line Navigation

🛠️ Advanced Editing

Change Operations

Text Objects

📑 Multiple Files

Buffer Operations

Window Operations

🎨 Customization

Settings

Configuration

📚 Macros

Recording

💡 Best Practices

  1. Navigation

    • Use motions over arrow keys

    • Learn text objects

    • Master search operations

    • Use marks for quick navigation

  2. Editing

    • Use registers effectively

    • Learn compound commands

    • Use macros for repetitive tasks

    • Master visual mode

  3. Configuration

    • Customize your .vimrc

    • Use plugins wisely

    • Create useful mappings

    • Document your settings

🔧 Advanced Features

Marks

Registers

Tags

🎓 Learning Path

  1. Beginner Level

    • Basic navigation (hjkl)

    • Basic editing (i, a, d, y, p)

    • Save and quit commands

    • Simple searches

  2. Intermediate Level

    • Text objects

    • Visual mode

    • Multiple windows

    • Basic macros

  3. Advanced Level

    • Complex text objects

    • Advanced macros

    • Registers

    • Custom mappings

🚀 Productivity Tips

  1. Speed Optimization

    • Use relative numbers

    • Master text objects

    • Use marks

    • Create mappings

  2. Common Workflows

    • Multiple file editing

    • Search and replace

    • Code navigation

    • Block operations

  3. Plugin Management

    • Essential plugins

    • Plugin managers

    • Custom configurations

    • Performance tuning

Last updated

Was this helpful?