Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Vim (text editor)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Interface == [[File:Gvim-7.3-menu.png|thumb|gVim 7.3]] Like [[Vi (text editor)|vi]], Vim's interface is not based on [[menu (computing)|menus]] or [[icon (computing)|icons]] but on commands given in a [[text user interface]]; its [[GUI]] mode, '''gVim''', adds menus and toolbars for commonly used commands but the full functionality is still expressed through its [[command line]] mode. Vi (and by extension Vim) tends to allow a typist to keep their fingers on the [[home row]], which can be an advantage for a [[Touch typing|touch typist]].<ref name=Lamb1998>{{cite book|last1=Lamb|first1=Linda|last2=Robbins|first2=Arnold|title=Learning the Vi Editor|date=1998|publisher=O'Reilly Media, Inc.|isbn=9781565924260|page=[https://archive.org/details/learningvieditor00lamb/page/305 305]|url-access=registration|url=https://archive.org/details/learningvieditor00lamb/page/305}}</ref> Vim has a built-in [[tutorial#Computer-based tutoring|tutorial]] for beginners called vimtutor, which is usually installed along with Vim, but is a separate executable and can be run with a shell command.<ref>{{cite web|url=http://vimdoc.sourceforge.net/htmldoc/usr_01.html#tutor|title=Vim documentation: usr_01|last=Moolenaar|first=Bram|date=3 November 2010|access-date=28 August 2019|archive-date=29 July 2020|archive-url=https://web.archive.org/web/20200729064500/http://vimdoc.sourceforge.net/htmldoc/usr_01.html#tutor|url-status=live}}</ref> The Vim [[User guide|Users' Manual]] details Vim's features and can be read from within Vim, or found online.<ref>[https://vimhelp.org/ Vim help files] {{Webarchive|url=https://web.archive.org/web/20190113232300/https://vimhelp.org/ |date=13 January 2019 }} at vimhelp.org</ref><ref name="vimbook">{{Cite book|title=Vi IMproved (VIM)|isbn=0-7357-1001-5|first=Steve|last=Oualline|publisher=New Riders Publishers|date=April 2001|url=http://ftp.vim.org/pub/vim/doc/book/vimbook-OPL.pdf|access-date=11 October 2021|archive-date=19 November 2021|archive-url=https://web.archive.org/web/20211119082135/http://ftp.vim.org/pub/vim/doc/book/vimbook-OPL.pdf|url-status=live}}</ref> Vim also has a built-in help facility (using the <code>:help</code> command) which allows users to query and navigate through commands and features. === Registers === Vim features various special memory entries called registers (not to be confused with hardware or [[processor register]]s). When [[cut, copy, and paste|cutting, deleting, copying, or pasting]] text the user can choose to store the manipulated text in a register. There are 36 general-purpose registers associated with letters and numbers ([a-z0-9]) and a range of special ones that either contain special values (current filename, last command, etc.) or serve a special purpose.{{r|:2|page=85}} === Modes === [[File:Vim modes.svg|thumb|Vim modes]] Like vi, vim supports multiple editing modes. Depending on the mode, typed characters are interpreted either as sequences of commands or are inserted as text. In Vim there are 14 editing modes, 7 basic modes and 7 variants:<ref>{{cite web |last1=Moolenaar |first1=Bram |title=Vim: intro.txt |url=https://vimhelp.org/intro.txt.html |website=vimhelp.org |access-date=1 September 2023}}</ref> * '''Normal''' mode β used for editor commands. This is generally the default mode and by default hitting {{key press|ESC}} returns the editor to this mode. * '''Insert''' mode β used for typing text in a way similar to most modern editors. In this mode, opened text in buffers can be modified with the text entered from the keyboard.<ref name=":1">{{Cite web |title=CS107 The Vim Editor |url=https://web.stanford.edu/class/cs107/resources/vim.html |url-status=live |archive-url=https://web.archive.org/web/20230127153621/https://web.stanford.edu/class/cs107/resources/vim.html |archive-date=27 January 2023 |access-date=2023-01-27 |website=web.stanford.edu}}</ref>{{r|Lamb1998|pp=12}} * '''Visual''' mode β used to select areas of text. Commands can be run on the selected area β moving, editing, filtering via built-in or external command, etc. ** '''Visual linewise''', a subtype of visual mode which selects one or more whole lines ** '''Visual blockwise''', another subtype which selects a rectangular block of text across one or more lines * '''Select''' mode β similar to visual, but the commands are not interpreted, instead, highlighted text is directly replaced by input from the keyboard; similar to the selection mode used in editors on Microsoft Windows platforms * '''Command-line''' or '''Cmdline''' mode β provides a single line input at the bottom of the Vim window. Commands (beginning with {{key press|:}}) and some other keys for specific actions (including pattern search and the filter command) activate this mode. On completion of the command, Vim returns to the previous mode.<ref name=":1" />{{r|Lamb1998|pp=12}} * '''Ex''' mode β accepts a sequence of commands. * '''Terminal-Job''' mode - Interacting with a job in a terminal window.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)