VIM(1)
π VIM(1) π
okay bestie, so this is the General Commands Manual page for vim, and honestly? it's giving "the most iconic text editor of all time" energy π. there's a lot here so stay with me β every flag matters, i promise.
β¨ NAME β¨
vim β Vi IMproved, a programmer's text editor. that's it, that's the whole name. slay π
πΈ SYNOPSIS πΈ
vim [options] [file ..]
vim [options] -
vim [options] -t tag
vim [options] -q [errorfile]
ex
view
gvim gview evim eview
rvim rview rgvim rgview
like, all of these are valid ways to summon it. the last block? that's the "call me by a different name and i'll act different" thing, which we'll get to π
π¦ DESCRIPTION π¦
so Vim is a text editor that is upwards compatible to Vi β meaning anything Vi can do, Vim can do better, no cap. it can edit, like, all kinds of plain text, and it is especially useful for editing programs (yes, that's the whole reason it exists, and yes it ate π₯).
there are a lot of enhancements on top of Vi, bestie:
- multi level undo
- multi windows and buffers
- syntax highlighting
- command line editing
- filename completion
- on-line help
- visual selection
- etc. (the manpage literally says "etc..", icon behavior β¨)
want the full rundown of how Vim differs from Vi? <green>:help vi_diff.txt</green> has a summary. iykyk π«Ά
while Vim is running you can get a lot of help from the on-line help system with the <green>:help</green> command. check the ON-LINE HELP section below (that's a whole other part of the manual, not this one, okay? π).
π‘ most of the time you just start Vim to edit a single file, like: text vim file
more generally, Vim gets started with:
vim [options] [filelist]
if the filelist is missing, the editor starts with an empty buffer. otherwise, you use exactly one out of the following four ways to choose which file(s) to edit β not two, not three, exactly one, bestie π
π ways to pick your file(s)
file ..β a list of filenames. the first one becomes the current file and gets read into the buffer. the cursor lands on the first line of the buffer. you get to the other files with the<green>:next</green>command. and if you ever need to edit a file whose name starts with a dash, precede the whole filelist with--(so, like,vim -- -weirdfileenergy π).-β the file to edit is read from stdin. commands are read from stderr, which should be a tty. yes, it's that iconic little combo πΌ.-t {tag}β the file to edit and the initial cursor position both depend on a "tag", which is basically a sort of goto label.{tag}gets looked up in the tags file, and the associated file becomes the current file, and the associated command gets executed. mostly this is used for C programs, where{tag}could be a function name π . the effect: the file containing that function becomes the current file and the cursor is positioned on the start of the function. see<green>:help tag-commands</green>.-q [errorfile]β start in quickFix mode. the file[errorfile]is read and the first error is displayed π. if[errorfile]is omitted, the filename comes from the'errorfile'option (defaults to"AztecC.Err"for the Amiga, and"errors.err"on other systems). jump to further errors with<green>:cn</green>. see<green>:help quickfix</green>.
π§ how Vim behaves depends on the name you called it
for real, the executable may still be the same file β Vim is just built different depending on what you named it. vibe check:
vimβ the "normal" way. everything is default. the main character π«Άexβ start in Ex mode. get to Normal mode with the<green>:vi</green>command. can also be done with the-eargument.viewβ start in read-only mode. you'll be protected from writing the files π. can also be done with the-Rargument.gvim gviewβ the GUI version. starts a new window πͺ. can also be done with the-gargument.evim eviewβ the GUI version in easy mode. starts a new window. can also be done with the-yargument.rvim rview rgvim rgviewβ like the above, but with restrictions π. it will not be possible to start shell commands, or to suspend Vim. can also be done with the-Zargument.
π OPTIONS π
kay so general rules first, because the manpage said so:
- the options may be given in any order, before or after filenames (yes, literally any order, she's flexible β¨)
- options without an argument can be combined after a single dash (so
-xyzis a whole mood)
+[num]β for the first file, the cursor will be positioned on line"num". if"num"is missing, the cursor lands on the last line. (so just+alone = "take me to the end" π)+/{pat}β for the first file, the cursor will be positioned on the line with the first occurrence of{pat}. see<green>:help search-pattern</green>for the available search patterns π+{command}and-c {command}β{command}will be executed after the first file has been read.{command}is interpreted as an Ex command. if{command}contains spaces it must be enclosed in double quotes (this depends on the shell that is used, so like, know your shell bestie π«Ά). example:
vim "+set si" main.c
β Note: you can use up to 10"+"or-ccommands. ten. not eleven. the limit is real.
-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 make it possible to edit a binary or executable file π§¬-Cβ Compatible. sets the'compatible'option. this makes Vim behave mostly like Vi, even though a.vimrcfile exists (she's cosplaying, okay?)-dβ start in diff mode. there should be 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<green>:sh</green>and<green>:!</green>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. so like... she's a historical icon now.
-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 entirely, by giving the name"NONE"(bye bestie π).-lβ Lisp mode. sets the'lisp'and'showmatch'options on.-Lβ same as-r. (yes, that's the whole description. she's brief π )-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 (so like, it's a vibe, not a prison π«Ά).-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<green>:set uc=0</green>. can be undone with<green>:set uc=200</green>.-Nβ No-compatible mode. resets the'compatible'option. this makes Vim behave a bit better, but less Vi compatible, even though a.vimrcfile does not exist. (growth, honestly π±)-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<green>:help recovery</green>π«Ά-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<green>:w!</green>. the-Roption also implies the-noption (see above π). the'readonly'option can be reset with<green>:set noro</green>. see<green>:help 'readonly'</green>.-sβ Silent mode. only when started as"Ex"or when the-eoption was given before the-soption π€«-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<green>:source! {scriptin}</green>. if the end of the file is reached before the editor exits, further characters are read from the keyboard πΉ-S {file}β okay so after Vim reads the first file, it sources{file}. This is literally equivalent to-c "source {file}".{file}cannot start with'-'. If{file}is omitted,"Session.vim"is used, and that only works when-Sis the last argument. π«Ά-T {terminal}β tells Vim the name of the terminal you're using. Only required when the automatic way doesn't work. It should be a terminal known to Vim (builtin) or defined in thetermcaporterminfofile. β¨-u {vimrc}β use the commands in the file{vimrc}for initializations. All the other initializations are skipped. Use this to edit a special kind of files. You can also skip all initializations by giving the name"NONE". See":help initialization"within vim for more details. π-U {gvimrc}β use the commands in the file{gvimrc}for GUI initializations. All the other GUI initializations are skipped. You can also skip all GUI initializations by giving the name"NONE". See":help gui-init"within vim for more details. π-vβ start Vim in Vi mode, just like the executable was called"vi". This only has effect when the executable is called"ex". π-V[N]β verbose, bb. Give messages about which files are sourced and for reading and writing a viminfo file. The optional number N is the value for'verbose'. Default is 10. π₯-V[N]{filename}β like-Vand set'verbosefile'to{filename}. The result is that messages are not displayed but written to the file{filename}.{filename}must not start with a digit. β¨-w{number}β set the'window'option to{number}. π-w {scriptout}β all the characters that you type are recorded in the file{scriptout}, until you exit Vim. This is useful if you want to create a script file to be used with"vim -s"or":source!". If the{scriptout}file exists, characters are appended. π¦-W {scriptout}β like-w, but an existing file is overwritten. π-xβ if Vim has been compiled with encryption support, use encryption when writing files. Will prompt 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. β¨-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 behave like a click-and-type editor. π-Zβ restricted mode. Works like the executable starts with"r". π₯--β denotes the end of the options. Arguments after this will be handled as a file name. This can be used to edit a filename that starts with a'-'. π--cleanβ do not use any personal configuration (vimrc, plugins, etc.). Useful to see if a problem reproduces with a clean Vim setup. πΈ--cmd {command}β like using"-c", but the command is executed just before processing any vimrc file. You can use up to 10 of these commands, independently from"-c"commands. π«Ά--echo-widβ GTK GUI only: echo the Window ID on stdout. π--gui-dialog-file {name}β when using the GUI, instead of showing a dialog, write the title and message of the dialog to file{name}. The file is created or appended to. Only useful for testing, to avoid that the test gets stuck on a dialog that can't be seen. Without the GUI the argument is ignored. π§--help,-h,-?β give a bit of help about the command line arguments and options. After this Vim exits. π--literalβ take file name arguments literally, do not expand wildcards. This has no effect on Unix where the shell expands wildcards. π--log {filename}β if Vim has been compiled with eval and channel feature, start logging and write entries to{filename}. This 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 the user knows that the input and/or output is not connected to a terminal. This will avoid the warning and the two second delay that would happen. π--remoteβ connect to a Vim server and make it edit the files given in the rest of the arguments. If no server is found a warning is given and the files are edited in the current Vim. β¨--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-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. πΈ--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 used with a--remoteargument, then it's the name of the server to connect to. If the socketserver backend is being used, if the name starts with"/","./", or"../", it 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. The$VIM_CLIENTSERVERenvironment variable may also be set which will be interpreted in the same way, but the--clientserverargument will always take 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}. π--ttyfailβ when stdin or stdout is not a terminal (tty) then exit right away. π--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" to get help for the "ZZ" command. Use Tab and CTRL-D to complete subjects (":help cmdline-completion"). Tags are present to jump from one place to another (sort of hypertext links, see ":help"). All documentation files can be viewed in this way, for example ":help syntax.txt". π
π FILES π
Okay, here's where everything lives, no cap:
/usr/share/vim/vim92/doc/*.txtβ the Vim documentation files. Use":help doc-file-list"to get the complete list. (vim??is 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β 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 π
Also peep vimtutor(1), bestie. π
π 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. π See ":help todo" for a list of known problems.
Note that a number of things that may be regarded as bugs by some, are in fact caused by a too-faithful reproduction of Vi's behaviour. And if you think other things are bugs "because Vi does it differently", you should take a closer look at the vi_diff.txt file (or type :help vi_diff.txt when in Vim). Also have a look at the 'compatible' and 'cpoptions' options. π«Ά
mwah π β that's a wrap on the VIM(1) man page, dated 2026 Jun 05. Catch you in the group chat, bestie. π
π¦ where this page comes from
- ubuntu stonking: vim-gui-common 2:9.2.0858-1ubuntu2 Β· Vim
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms