VIM(1)
VIM(1) โ straight out of the General Commands Manual ๐ฆ๐
โจ NAME โจ
vim โ Vi IMproved, a programmer's text editor. yeah bestie, that's the whole thing, and it's iconic for a reason ๐
๐ SYNOPSIS ๐
vim [options] [file ..]
vim [options] -
vim [options] -t tag
vim [options] -q [errorfile]
ex gex
view
gvim gview vimx evim eview
rvim rview rgvim rgview
๐ธ DESCRIPTION ๐ธ
So. Vim is a text editor that is upwards compatible to Vi โ meaning all your Vi knowledge still slays here. It can edit literally all kinds of plain text, and it is especially useful for editing programs. it's giving "I was born to read your code" energy fr fr ๐
There are a LOT of enhancements above Vi, and the list is lowkey stacked:
- multi level undo ๐ฅ
- multi windows and buffers ๐ช
- syntax highlighting ๐
- command line editing โ๏ธ
- filename completion โก
- on-line help ๐ซถ
- visual selection ๐
- etc.. (the "etc.." is doing so much work here, bestie)
See ":help vi_diff.txt" for a summary of the differences between Vim and Vi. iykyk.
While running Vim a lot of help can be obtained from the on-line help system, with the ":help" command. See the ON-LINE HELP section below. it's genuinely there for you, no gatekeeping โจ
Most often Vim is started to edit a single file with the command
vim file
More generally Vim is started with:
vim [options] [filelist]
If the filelist is missing, the editor will start with an empty buffer. Otherwise exactly one out of the following four may be used to choose one or more files to be edited. pick one, babes, not all four ๐
file ..โ A list of filenames. The first one will be the current file and read into the buffer. The cursor will be positioned on the first line of the buffer. You can get to the other files with the":next"command. To edit a file that starts with a dash, precede the filelist with"--".-โ The file to edit is read from stdin. Commands are read from stderr, which should be a TTY.-t {tag}โ The file to edit and the initial cursor position depends on a "tag", a sort of goto label.{tag}is looked up in the tags file, the associated file becomes the current file and the associated command is executed. Mostly this is used for C programs, in which case{tag}could be a function name. The effect is that the file containing that function becomes the current file and the cursor is positioned on the start of the function. See":help tag-commands". โจ-q [errorfile]โ Start in quickFix mode. The file[errorfile]is read and the first error is displayed. If[errorfile]is omitted, the filename is obtained from the'errorfile'option (defaults to"AztecC.Err"for the Amiga,"errors.err"on other systems). Further errors can be jumped to with the":cn"command. See":help quickfix". ๐ฅ
๐ฆ Vim behaves differently, depending on the name of the command ๐ฆ
(the executable may still be the same file โ it's one binary with a whole wardrobe, main character energy)
vimโ The "normal" way, everything is default. ๐exโ Start in Ex mode. Go to Normal mode with the":vi"command. Can also be done with the"-e"argument.viewโ Start in read-only mode. You will be protected from writing the files. Can also be done with the"-R"argument. ๐ก๏ธgvim gviewโ The GUI version. Starts a new window.gexโ Starts a new gvim window in Ex mode. Can also be done with the"-e"argument to gvimvimxโ Starts gvim in "Vi" mode similar to "vim", but with additional features like xterm clipboard supportevim eviewโ The GUI version in easy mode. Starts a new window. Can also be done with the"-y"argument. ๐rvim rview rgvim rgviewโ Like the above, but with restrictions. It will not be possible to start shell commands, or suspend Vim. Can also be done with the"-Z"argument.
๐ OPTIONS ๐
The options may be given in any order, before or after filenames. Options without an argument can be combined after a single dash. slay, freedom of ordering โจ
+[num]โ For the first file the cursor will be positioned on line"num". If"num"is missing, the cursor will be positioned on the last line. ๐+/{pat}โ For the first file the cursor will be positioned in the line with the first occurrence of{pat}. See":help search-pattern"for the available search patterns.+{command},-c {command}โ{command}will be executed after the first file has been read.{command}is interpreted as an Ex command. If the{command}contains spaces it must be enclosed in double quotes (this depends on the shell that is used). Example:
vim "+set si" main.c
Note: You can use up to 10 "+" or "-c" commands.
-Aโ If Vim has been compiled with ARABIC support for editing right-to-left oriented files and Arabic keyboard mapping, this option starts Vim in Arabic mode, i.e.'arabic'is set. Otherwise an error message is given and Vim aborts.-bโ Binary mode. A few options will be set that makes it possible to edit a binary or executable file.-Cโ Compatible. Set the'compatible'option. This will make Vim behave mostly like Vi, even though a.vimrcfile exists.-dโ Start in diff mode. There should between two to eight file name arguments. Vim will open all the files and show differences between them. Works likevimdiff(1).-d {device},-dev {device}โ Open{device}for use as a terminal. Only on the Amiga. Example:"-d con:20/30/600/150".-Dโ Debugging. Go to debugging mode when executing the first command from a script.-eโ Start Vim in Ex mode, just like the executable was called"ex".-display {display}โ Run Vim on{display}, connecting to that X server instead of the one in$DISPLAY. The"--display"long form is accepted only by the GTK+ 2 or GTK+ 3 GUI. Both forms require the+xterm_clipboardfeature. ๐ฅ๏ธ-Eโ Start Vim in improved Ex mode, just like the executable was called"exim".-fโ Foreground. For the GUI version, Vim will not fork and detach from the shell it was started in. On the Amiga, Vim is not restarted to open a new window. This option should be used when Vim is executed by a program that will wait for the edit session to finish (e.g. mail). On the Amiga the":sh"and":!"commands will not work.-Fโ If Vim has been compiled with FKMAP support for editing right-to-left oriented files and Farsi keyboard mapping, this option starts Vim in Farsi mode, i.e.'fkmap'and'rightleft'are set. Otherwise an error message is given and Vim aborts.
Note: Farsi support has been removed in patch 8.1.0932. ๐ rip
-gโ If Vim has been compiled with GUI support, this option enables the GUI. If no GUI support was compiled in, an error message is given and Vim aborts.-Hโ If Vim has been compiled with RIGHTLEFT support for editing right-to-left oriented files and Hebrew keyboard mapping, this option starts Vim in Hebrew mode, i.e.'hkmap'and'rightleft'are set. Otherwise an error message is given and Vim aborts.-i {viminfo}โ Specifies the filename to use when reading or writing the viminfo file, instead of the default"~/.viminfo". This can also be used to skip the use of the.viminfofile, by giving the name"NONE". ๐-lโ Lisp mode. Sets the'lisp'and'showmatch'options on.-Lโ Same as-r.-mโ Modifying files is disabled. Resets the'write'option. You can still modify the buffer, but writing a file is not possible.-Mโ Modifications not allowed. The'modifiable'and'write'options will be unset, so that changes are not allowed and files can not be written. Note that these options can be set to enable making modifications.-nโ No swap file will be used. Recovery after a crash will be impossible. Handy if you want to edit a file on a very slow medium (e.g. floppy). Can also be done with":set uc=0". Can be undone with":set uc=200".-Nโ No-compatible mode. Resets the'compatible'option. This will make Vim behave a bit better, but less Vi compatible, even though a.vimrcfile does not exist.-nbโ Become an editor server for NetBeans. See the docs for details.-o[N]โ OpenNwindows stacked. WhenNis omitted, open one window for each file.-O[N]โ OpenNwindows side by side. WhenNis omitted, open one window for each file.-p[N]โ OpenNtab pages. WhenNis omitted, open one tab page for each file. ๐๏ธ-P {parent-title}โ Win32 GUI only: Specify the title of the parent application. When possible, Vim will run in an MDI window inside the application.{parent-title}must appear in the window title of the parent application. Make sure that it is specific enough. Note that the implementation is still primitive. It won't work with all applications and the menu doesn't work.-rโ List swap files, with information about using them for recovery.-r {file}โ Recovery mode. The swap file is used to recover a crashed editing session. The swap file is a file with the same filename as the text file with".swp"appended. See":help recovery". ๐ซถ-Rโ Read-only mode. The'readonly'option will be set. You can still edit the buffer, but will be prevented from accidentally overwriting a file. If you do want to overwrite a file, add an exclamation mark to the Ex command, as in":w!". The-Roption also implies the-noption (see above). The'readonly'option can be reset with":set noro". See":help 'readonly'".-sโ Silent mode. Only when started as"Ex"or when the"-e"option was given before the"-s"option.-s {scriptin}โ The script file{scriptin}is read. The characters in the file are interpreted as if you had typed them. The same can be done with the command":source! {scriptin}". If the end of the file is reached before the editor exits, further characters are read from the keyboard. โจ๏ธ-S {file}โ sources{file}right after the first file has been read, bestie. It's literally the same as doing-c "source {file}". One lil rule tho:{file}can't start with a-. And if you just... don't give a{file}at all? It uses"Session.vim"instead โ but only when-Sis the very last argument. ๐-T {terminal}โ tells Vim which terminal you're on. You only need this when the automatic detection is being lazy and doesn't work. It should be a terminal Vim knows about (builtin), or one defined in the termcap or terminfo file.-u {vimrc}โ use the commands in{vimrc}for initializations, and skip all the other initializations. Perfect for editing a very specific kind of files. You can also skip literally everything by passing the name"NONE". More deets in:help initializationinside Vim. โจ-U {gvimrc}โ same vibe but for the GUI: use the commands in{gvimrc}for GUI initializations, and skip all the other GUI initializations. Give it the name"NONE"to skip every GUI init entirely. See:help gui-initinside Vim for the lore.-vโ start Vim in Vi mode, like the executable had been called"vi". Ngl this only does anything when the executable is called"ex".-V[N]โ verbose mode, queen. Spills messages about which files are sourced and about reading and writing a viminfo file. The optional numberNis the value for'verbose'. Default is10.-V[N]{filename}โ same as-Vbut also sets'verbosefile'to{filename}. So instead of showing you those messages, it writes them into the file{filename}. Heads up:{filename}must not start with a digit. ๐ซ-w{number}โ sets the'window'option to{number}.-w {scriptout}โ records every single character you type into the file{scriptout}, all the way until you exit Vim. Iconic for making a script file to use with"vim -s"or":source!". If the{scriptout}file already exists, characters get appended.-W {scriptout}โ like-w, except an existing file gets overwritten. no cap.-xโ if Vim was compiled with encryption support, use encryption when writing files. It'll prompt you for a crypt key. ๐-Xโ don't connect to the X server. Shortens startup time in a terminal, but the window title and clipboard will not be used. Tradeoffs, bestie.-Yโ don't connect to the wayland compositor.-yโ start Vim in easy mode, just like the executable was called"evim"or"eview". Makes Vim act like a click-and-type editor. ๐ฑ๏ธ-Zโ restricted mode. Works like the executable starts with"r".--โ this one denotes the end of the options. Anything after it gets handled as a file name. Super useful when you need to edit a filename that starts with a-. โจ--cleanโ do not use any personal configuration at all (vimrc, plugins, etc.). Chef's kiss for checking whether a problem still reproduces with a clean Vim setup.--cmd {command}โ like using"-c", but the command runs just before any vimrc file is processed. You can stack up to 10 of these, and they're independent from"-c"commands.--echo-widโ GTK GUI only: echoes the Window ID on stdout.--gui-dialog-file {name}โ when you're in the GUI, instead of actually showing a dialog, it writes the title and message of the dialog to file{name}. The file gets created or appended to. Only useful for testing, so a test doesn't get stuck on a dialog that nobody can see. Without the GUI, the argument is just ignored. ๐--help,-h,-?โ gives you a bit of help about the command line arguments and options. After this, Vim exits.--literalโ take file name arguments literally, don't expand wildcards. Has no effect on Unix, where the shell does the wildcard expansion anyway.--log {filename}โ if Vim was compiled with the eval and channel feature, start logging and write entries to{filename}. Works like callingch_logfile({filename}, 'ao')very early during startup.--noforkโ foreground. For the GUI version, Vim will not fork and detach from the shell it was started in.--nopluginโ skip loading plugins. Implied by-u NONE.--not-a-termโ tells Vim that you, the user, know that the input and/or output is not connected to a terminal. Avoids the warning and the two second delay that would otherwise happen. โฑ๏ธ--prg-name {name}โ set the GTK program name. Only for GTK4 GUI.--remoteโ connect to a Vim server and make it edit the files given in the rest of the arguments. If no server is found, you get a warning and the files are edited in the current Vim instead.--remote-expr {expr}โ connect to a Vim server, evaluate{expr}in it, and print the result on stdout.--remote-send {keys}โ connect to a Vim server and send{keys}to it.--remote-silentโ as--remote, but without the warning when no server is found. ๐คซ--remote-tabโ as--remote, but open each file in a new tabpage.--remote-tab-silentโ as--remote-silent, but open each file in a new tabpage.--remote-tab-waitโ as--remote-wait, but open each file in a new tabpage.--remote-tab-wait-silentโ as--remote-wait-silent, but open each file in a new tabpage.--remote-waitโ as--remote, but Vim does not exit until the files have been edited.--remote-wait-silentโ as--remote-wait, but without the warning when no server is found.--remote-tab[-wait][-silent]โ as--remotebut use a tab page per file.--roleโ set a unique role to identify the main window.--serverlistโ list the names of all Vim servers that can be found. ๐--servername {name}โ use{name}as the server name. Used for the current Vim, unless it's used with a--remoteargument, in which case it's the name of the server to connect to. And if the socketserver backend is being used, a name starting with"/","./", or"../"is taken as either an absolute, relative or relative path to the socket.--clientserver {backend}โ use{backend}as the backend for clientserver functionality, either"socket","x11", or"mswin"respectively. Only available when compiled with both socketserver and X11 features present, or if compiled with socketserver on MS-Windows. You can also set the$VIM_CLIENTSERVERenvironment variable, which gets interpreted the same way โ but the--clientserverargument always takes priority. ๐--socketid {id}โ GTK GUI only: use the GtkPlug mechanism to run gVim in another window.--startuptime {file}โ during startup, write timing messages to the file{fname}.--stdio-channelโ use the stdin and stdout of Vim for a channel instead of for a terminal. Implies"-es": nothing is displayed, no Ex commands are read, and the GUI is not started. A script opens the channel withch_open()and the address"stdio", see:help --stdio-channel. Only available when compiled with the channel feature.--ttyfailโ when stdin or stdout is not a terminal (tty), exit right away. bye bestie ๐--versionโ print version information and exit.--windowid {id}โ Win32 GUI only: make gVim try to use the window{id}as a parent, so that it runs inside that window.
๐ฆ ON-LINE HELP ๐ฆ
Type ":help" in Vim to get started, bestie. Type ":help subject" to get help on a specific subject. For example: ":help ZZ" gets you help for the "ZZ" command. Use Tab and CTRL-D to complete subjects (":help cmdline-completion"). Tags are there so you can jump from one place to another (sort of like hypertext links, see ":help"). All the documentation files can be viewed this way, for example ":help syntax.txt". โจ
๐ธ FILES ๐ธ
/usr/share/vim/vim92/doc/*.txtโ the Vim documentation files. Use":help doc-file-list"to get the complete list.vim??is the short version number, likevim91for Vim 9.1./usr/share/vim/vim92/doc/tagsโ the tags file used for finding information in the documentation files./usr/share/vim/vim92/syntax/syntax.vimโ system wide syntax initializations./usr/share/vim/vim92/syntax/*.vimโ syntax files for various languages./usr/share/vim/vimrcโ system wide Vim initializations.~/.vimrc,~/.vim/vimrc,$XDG_CONFIG_HOME/vim/vimrcโ your personal Vim initializations (first one found is used). ๐/usr/share/vim/gvimrcโ system wide gvim initializations.~/.gvimrc,~/.vim/gvimrc,$XDG_CONFIG_HOME/vim/gvimrcโ your personal gVim initializations (first one found is used)./usr/share/vim/vim92/optwin.vimโ the script used for the":options"command, a nice way to view and set options./usr/share/vim/vim92/menu.vimโ system wide menu initializations for gVim./usr/share/vim/vim92/bugreport.vimโ script to generate a bug report. See":help bugs"./usr/share/vim/vim92/filetype.vimโ script to detect the type of a file by its name. See":help 'filetype'"./usr/share/vim/vim92/scripts.vimโ script to detect the type of a file by its contents. See":help 'filetype'"./usr/share/vim/vim92/print/*.psโ files used for PostScript printing.
For recent info read the VIM home page: <URL:http://www.vim.org/>
๐ SEE ALSO ๐
๐ AUTHOR ๐
Most of Vim was made by Bram Moolenaar, with a lot of help from others. See ":help credits" in Vim.
Vim is based on Stevie, worked on by: Tim Thompson, Tony Andrews and G.R. (Fred) Walter. Although hardly any of the original code remains. ๐ซถ
๐ BUGS ๐
Probably. ๐ญ Like, yes, bestie, there are bugs. That's just the vibe. Run :help todo and you'll get the whole receipts list of known problems. Go look, it's all there.
Okay but here's the thing, and this is important, so pay attention ๐ซถ โ a bunch of stuff that some people wanna call bugs is actually on purpose. Vim is being extremely faithful to how Vi behaves. Like, too faithful. Iconically faithful. It's not a bug, it's a reproduction ๐
And if you're out here thinking something's a bug "because Vi does it differently"? Ma'am. ๐ฉ Take a closer look at the vi_diff.txt file first. Or honestly just type this while you're in Vim:
:help vi_diff.txt
That's it. That's the homework. โจ
Also, while you're at it, go peek at the 'compatible' and 'cpoptions' options โ they explain a whole lot of the "wait why is it like this" energy. ๐ฆ iykyk
And that's a wrap on the whole page, bestie ๐ This one's from the source dated 2026 Sep 28 and it's page VIM(1) โ go forth and :q responsibly. Slay ๐
๐ฆ where this page comes from
- fedora 43: vim-common 2:9.2.1202-1.fc43 ยท Vim AND LGPL-2.1-or-later AND MIT AND GPL-1.0-only AND (GPL-2.0-only OR Vim) AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND GPL-2.0-or-later AND GPL-3.0-or-later AND OPUBL-1.0 AND Apache-2.0 WITH Swift-exception
- fedora 44: vim-common 2:9.2.1202-1.fc44 ยท Vim AND LGPL-2.1-or-later AND MIT AND GPL-1.0-only AND (GPL-2.0-only OR Vim) AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND GPL-2.0-or-later AND GPL-3.0-or-later AND OPUBL-1.0 AND Apache-2.0 WITH Swift-exception
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms