File Viewing & Editing

vim

Vi Improved — a highly configurable text editor built on vi with extensive plugin support.

Synopsis

syntax
vim [OPTION]... [FILE]...

Examples

Open a file in vim
vim file.txt
Open multiple files in tabs
vim -p file1.txt file2.txt
Diff two files side by side
vim -d old.conf new.conf
Open with line numbers enabled
vim +':set number' script.py

Common options

FlagDescription
-pOpen files in tabs
-OOpen files in vertical splits
-dDiff mode between files
-uUse specified vimrc
+cmdExecute command after loading

About vim

The `vim` command vi Improved — a highly configurable text editor built on vi with extensive plugin support. Text viewing and editing commands are fundamental tools in any Linux user's toolkit.

Linux treats almost everything as a file, so the ability to quickly inspect, filter, transform, and edit file contents from the command line is critical. These commands are regularly combined with pipes and redirects to build powerful data-processing pipelines.

The command accepts 5 commonly used flags shown above, though the full set of options is available in the man page (`man vim`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More File Viewing & Editing Commands

Other commands in the File Viewing & Editing category

Related tools