Skip to main content

Vim

Vim is a highly configurable, efficient, and powerful text editor built to enable fast text editing. It is an improved version of the classic vi editor, available on almost every Unix-like system. Vim is popular among developers and system administrators for its keyboard-driven workflow, extensibility, and support for scripting.


🌟 Key Features

  • Modal Editing: Vim has different modes (Normal, Insert, Visual, Command) for efficient text manipulation.
  • Keyboard-Centric: Most actions are performed via keyboard shortcuts, minimizing mouse use.
  • Extensible: Supports plugins, custom key mappings, and scripting (Vimscript, Lua, Python).
  • Ubiquitous: Available on Linux, macOS, Windows, and even embedded systems.
  • Lightweight: Fast startup and low resource usage.

🛠️ Common Commands

vim file.txt         # Open file.txt in Vim
i # Switch to Insert mode
Esc # Return to Normal mode
:w # Save file
:q # Quit Vim
:wq # Save and quit
:q! # Quit without saving
dd # Delete (cut) current line
yy # Copy (yank) current line
p # Paste below
u # Undo
Ctrl+r # Redo
/word # Search for 'word'
:n # Go to next search result
:%s/foo/bar/g # Replace all 'foo' with 'bar'
:help # Open Vim help

📦 Plugins & Customization



📝 Notes

  • Vim has a steep learning curve, but mastering it can greatly improve productivity.
  • Configuration is typically stored in ~/.vimrc.
  • Neovim is a modern fork of Vim with additional features and improvements.