Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Vim (text editor)

From Wikipedia, the free encyclopedia

Improved version of the vi text editor
Vim
Vim running in aterminal emulator
Original authorBram Moolenaar
Initial releaseJanuary 1992 (public release of 1.14 inFish Disk #591)
Stable release
9.2[1] Edit this on Wikidata / 14 February 2026; 2 days ago (14 February 2026)
Written inC,Vim script
Operating systemUnix,Linux,Windows NT,MS-DOS,macOS,iOS,Android,Haiku,AmigaOS,MorphOS
TypeText editor
LicenseVim[2][3][4]
Websitewww.vim.org Edit this on Wikidata
Repository
For the original vi editor, seevi (text editor).

Vim (/vɪm/ ;[5] short forviimproved) is afree and open-sourcetext editor. Vim provides both a terminal screen user interface as well as agraphical user interface (called gvim).

Vim's documentation describes it as an improved form of the oldervi text editor (though it is built from a distinctcodebase). In release information, the author originally implied that Vim was an abbreviation for "Vi IMitation", but later, the expansion was changed to "Vi IMproved" because, as described by the author, the functionality had increased beyond that of aclone of vi. Some sources indicate the change happened with v2.0, but conflicting information (including from author) suggests the change happened as early as v2.0[dubiousdiscuss] and as late as v3.0.[6]

Since its original release for theAmiga, Vim has beenported to many environments includingAtariMiNT,BeOS,MS-DOS,Windows starting fromWindows NT 3.1,OS/2,OS/390,MorphOS,OpenVMS,QNX,RISC OS,Linux,BSD, andClassic Mac OS.[7] Also, Vim is shipped withApplemacOS.[8] Independent ports of Vim are available forAndroid[9][10] andiOS.[11]

Vim has been and continues to be popular forsoftware development. In 2018, it was voted the most popular editor amongstLinux Journal readers.[12] In 2015, theStack Overflow developer survey found it to be the third most popular text editor,[13] and, in 2019, the fifth most popular development environment.[14]

History

[edit]

In 1988,Bram Moolenaar began work on what would become Vim. He used thecodebase for theStevie editor ported toAmiga (by Tony Andrews et al.) as a starting point.[15][16] Version 1.14 (completed 2 November 1991) became the first public release. It was distributed viaFish Disk #591 in January 1992.[15][17][18][19][20]

License

[edit]

Vim is released under the Vimlicense, which includes somecharityware clauses that encourage users who enjoy the software to consider donating to children inUganda.[4] The Vim license is compatible with theGNU General Public License through a special clause allowing distribution of modified copies under theGNU GPL version 2.0 or later.[4]

User experience

[edit]
gVim 7.3

Text user interface

[edit]

Vim provides auser experience like vi's that integrates keyboard-entered command input with afull-screen editing experience.

Same as vi, Vim tends to allow a user with atypical keyboard to keep their fingers on thehome row, which can be an advantage fortouch typing.[21]

Graphical user interface

[edit]

Via itsGUI mode (called gVim), it presents an interface with more a modern experience including aspects such asmenus,toolbars andicons. The full functionality is still expressed through itscommand line mode.

Help

[edit]

Vim has a built-in help facility accessible via the:help command.

The Vimtutorial for beginners, called vimtutor, is usually installed alongside Vim, but is a separate executable and can be run separately.[22]

The Vim Users' Manual details Vim's features and can be read from within Vim, or found online.[23][24]

Registers

[edit]

Vim features various special memory entries called registers (not to be confused with hardware orprocessor registers). Whencutting, 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.[25]

Modes

[edit]
Vim modes

Like vi, Vim supports multiple editing modes. Depending on the mode, entered characters are either processed as command input or inserted as text. Vim has 14 modes (7 basic modes and 7 variants):[26]

Normal
For editor commands. Generally, this is the default mode andESC enters this mode.
Insert
For editing content like in a modern editor.[27][21]: 12 
Visual
For selecting areas of text. Commands can be run on the selected area – moving, editing, filtering via built-in or external command, etc.
Visual linewise
Selects one or more whole lines.
Visual blockwise
Selects a rectangular block of text across one or more lines.
Select
Similar to visual, but commands are not interpreted. Instead, highlighted text is directly replaced by input from the keyboard. This behavior mimics the selection mode in editors on Windows platforms.
Command-line (Cmdline)
Provides a single line input at the bottom of the terminal. Commands (beginning with:) and some other keys for specific actions (including pattern search and the filter command) activate this mode. On completion of the command, Vim reverts to the previous mode.[27][21]: 12 
Ex
Accepts a sequence of commands.
Terminal-Job
Interacting with a job in a terminal window.

Customization

[edit]

Vim is customizable and extensible, making it attractive to those who want control and flexibility in a text editing environment.[28] Users can execute complex commands withkey bindings, which can be customized and extended. Therecording feature allows for the creation ofmacros to automate sequences of keystrokes and call internal or user-defined functions and mappings. Abbreviations, similar to macros and key mappings, facilitate the expansion of short strings of text into longer ones and can also be used to correct mistakes. Vim also features aneasy mode for users wanting a simpler user experience.[29]

There are manyplugins available that extend or add new functionality to Vim. These plugins are usually written in Vim's internal scripting language, vimscript (also known as VimL),[30] but can be written in other languages as well.

There are projects bundling together complex scripts and customizations and aimed at turning Vim into a tool for a specific task or adding a major flavour to its behaviour. Examples include Cream, which makes Vim behave like a click-and-type editor, or VimOutliner, which provides a comfortableoutliner for users of Unix-like systems.

Improvements

[edit]

Vim provides many features beyond what vi provides.[31] Some of Vim's enhancements includecompletion functions,comparison andmerging of files (known as vimdiff), a comprehensive integrated help system, extendedregular expressions,scripting languages (both native and through alternative scripting interpreters such as Perl, Python, Ruby, Tcl, etc.) including support forplugins, agraphical user interface (gvim), limitedintegrated development environment-like features,mouse interaction (both with and without the GUI),folding, editing of compressed or archived files ingzip,bzip2,zip, andtar format and files over network protocols such asSSH,FTP, andHTTP, session state preservation,spell checking, split (horizontal and vertical) and tabbed windows,Unicode and other multi-language support,syntax highlighting, trans-session command, search and cursor positionhistories, multiple level and branchingundo/redo history which can persist across editing sessions, and visual mode.[citation needed]

Vim continually saves information to a file[a] that allows for recovering from a crash. Generally, thefile extension is ".swp", but if the user tries to open a file when the recovery file already exists, then Vim notifies the user of the condition. If the user confirms to proceed, Vim uses a different extension to form a name for a file that does not exist. The extensions are along the progression: ".swo", ".swn", ".swm", etc.[32][33] The feature can be disabled.[34]

Compatibility

[edit]

Vim provides a vi-compatibility mode that limits its functionality to be similar to that of vi. However, even in compatibility mode, Vim is not entirely compatible with vi as specified by POSIX.[35] For example, Vim does not support vi's open mode. Vim's developers state that it is "very much compatible with Vi".[36]

Vim script

[edit]

Vim script (also calledVimscript orVimL)[37] is thescripting language built into Vim.[38] Based on theex editor language of the original vi editor, early versions of Vim added commands for control flow and function definitions. Since version 7, Vim script also supports more advanced data types such aslists anddictionaries and a simple form ofobject-oriented programming. Built-in functions such asmap() andfilter() allow a basic form offunctional programming, and Vim script haslambda since version 8.0. Vim script is mostly written in animperative programming style.

Vimmacros can contain a sequence ofnormal-mode commands, but can also invoke ex commands or functions written in Vim script for more complex tasks. Almost all extensions (called plugins or more commonly scripts) of the core Vim functionality are written in Vim script, but plugins can also utilize other languages likePerl,[39]Python,[40]Lua,[41]Ruby,[42]Tcl,[43] orRacket.[44] These plugins can be installed manually, or through a plugin manager such as Vundle, Pathogen, or Vim-Plug.

Vim script files are stored as plain text, similarly to other code, and the filename extension is usually.vim. One notable exception to that is Vim's config file,.vimrc.

Examples

[edit]
" This is the Hello World program in Vim script.echo"Hello, world!"" This is a simple while loop in Vim script.leti=1whilei<5  echo"count is"ileti+=1endwhileunleti

Versions

[edit]
WhenVersionChanges
19881.0Bram Moolenaar starts development; never publicly released
2 Nov 19911.14The date Moolenaar ascribed to Vim's public release, based on the build date of version 1.14[17][18][20]
Jan 19921.14First public distribution; on Fish Disk #591[17][15]
19921.22[18]Port to Unix; never publicly released[6]
14 Dec 19932.0[45]First release using the abbreviation expansion "Vi IMproved"[6][dubiousdiscuss]
12 Aug 19943.0[18]Support for multiple windows
29 May 19964.0[18][46]Graphical user interface
19 Feb 19985.0[18][47]Syntax highlighting, basicscripting (user defined functions, commands, etc.)
6 Apr 19985.1Bug fixes, various improvements
27 Apr 19985.2Long line support, file browser, dialogs, popup menu, select mode, session files, user defined functions and commands,Tcl interface, etc.
31 Aug 19985.3Bug fixes, etc.
25 Jul 19995.4Basic file encryption, various improvements
19 Sep 19995.5Bug fixes, various improvements
16 Jan 20005.6New syntax files, bug fixes, etc.
24 Jun 20005.7New syntax files, bug fixes, etc.
31 May 20015.8New syntax files, bug fixes, etc.
26 Sep 20016.0[18][48]Folding,plugins, multi-language, etc.
24 Mar 20026.1Bug fixes
1 Jun 20036.2GTK2 and libgnome2 support, Arabic language support, :try command, minor features, bug fixes
7 Jun 20046.3Bug fixes, translation updates, mark improvements
15 Oct 20056.4Bug fixes, updates to Perl, Python, and Ruby support
7 May 20067.0[49]Spell checking,code completion, tab pages (multiple viewports/window layouts), current line and column highlighting, undo branches, and more
12 May 20077.1Bug fixes, new syntax and runtime files, etc.
9 Aug 20087.2[50]Floating point support in scripts, refactored screen drawing code, bug fixes, new syntax files, etc.
15 Aug 20107.3Lua support, Python3 support,Blowfish encryption, persistent undo/redo
10 Aug 20137.4[51]A new, faster regular expression engine.
12 Sep 20168.0[52]Asynchronous I/O support, jobs, lambdas, etc.
18 May 20188.1[53]Terminal window support and terminal gdb plugin.
13 Dec 20198.2[54]Popup windows, text properties.
28 Jun 20229.0[55]Vim9 script
2 Jan 20249.1[56]Classes and objects support for Vim9 script, smooth scrolling, virtual text
14 Feb 20269.2[57]Enums, Generic functions, and Tuples support for Vim9 script, improved diff mode, new completion features

See also

[edit]

Notes

[edit]
  1. ^ The crash recovery file is called aswapfile even though the name impliesmemory paging which is different technology.

References

[edit]
  1. ^Christian Brabandt (14 February 2026)."Vim 9.2 has been released!". Retrieved14 February 2026.
  2. ^"vim/LICENSE".github.com. 20 October 2021.Archived from the original on 16 August 2021. Retrieved5 July 2021.
  3. ^"Vim License".spdx.org.Archived from the original on 29 July 2021. Retrieved5 July 2021.
  4. ^abc"Vim: uganda.txt".vimhelp.org.Archived from the original on 13 January 2019. Retrieved13 January 2019.
  5. ^Vim documentation: introArchived 13 January 2019 at theWayback Machine: "Vim is pronounced as one word, like Jim, not vi-ai-em. It's written with a capital, since it's a name, again like Jim."
  6. ^abc"VILE (Vi Like Emacs) – Frequently Asked Questions (FAQ)".Archived from the original on 31 August 2019. Retrieved7 September 2019.
  7. ^":help sys-file-list"
    "Vim Online: Downloads".Archived from the original on 8 January 2007. Retrieved7 January 2007.
  8. ^"Mac OS X Manual Page For vim(1)".developer.apple.com. Apple Inc.Archived from the original on 9 June 2012. Retrieved12 January 2010.
  9. ^"VimTouch, the development has stalled on this app".GitHub.Archived from the original on 29 December 2015. Retrieved9 August 2015.
  10. ^"DroidVim, under active development".GitHub.Archived from the original on 27 June 2018. Retrieved5 March 2017.
  11. ^"Vim – Applidium, mobile agency in Paris". Archived fromthe original on 20 January 2012. Retrieved11 August 2015.
  12. ^"Best Editor | Linux Journal".www.linuxjournal.com. Retrieved20 April 2023.
  13. ^"Stack Overflow Developer Survey 2015 § IV. Text Editor". Stack Overflow.Archived from the original on 4 May 2019. Retrieved25 July 2016.
  14. ^"Stack Overflow Developer Survey 2019 Results". Stack Overflow § VII. Development Environments.Archived from the original on 7 March 2020. Retrieved20 July 2019.
  15. ^abcRobbins, Arnold; Hannah, Elbert (17 November 2021).Learning the Vi and Vim Editors.O'Reilly Media. p. 159.ISBN 978-1-4920-7877-7. Retrieved30 November 2025.
  16. ^
  17. ^abcMoolenaar, Bram (13 December 2016)."Vim 25 presentation by Bram Moolenaar on 2016 November 2". Retrieved30 November 2025.Moolenaar: Fred Fish Disk 591 was published in '92, actually, January '92, so why November 2? Well, that's because if you look at the binary, when it was built (and it's like the birth certificate of Vim), and you can see that it's actually November 2. So that's where it comes from.
  18. ^abcdefgMoolenaar, Bram (15 January 2002)."Vim, an open-source text editor".Archived from the original on 7 August 2011. Retrieved24 October 2005.
  19. ^"Textfiles.com".Archived from the original on 16 July 2011. Retrieved2 October 2009.
  20. ^abMoolenaar, Bram (10 October 2000)."The continuing story of Vim"(PDF).moolenaar.net.Archived(PDF) from the original on 18 April 2012. Retrieved19 September 2011.
  21. ^abcLamb, Linda; Robbins, Arnold (1998).Learning the Vi Editor. O'Reilly Media, Inc. p. 305.ISBN 9781565924260.
  22. ^Moolenaar, Bram (3 November 2010)."Vim documentation: usr_01".Archived from the original on 29 July 2020. Retrieved28 August 2019.
  23. ^Vim help filesArchived 13 January 2019 at theWayback Machine at vimhelp.org
  24. ^Oualline, Steve (April 2001).Vi IMproved (VIM)(PDF). New Riders Publishers.ISBN 0-7357-1001-5.Archived(PDF) from the original on 19 November 2021. Retrieved11 October 2021.
  25. ^McDonnell, Mark (2014).Pro vim. [Berkeley]: Apress. p. 85.ISBN 978-1-4842-0250-0.OCLC 897466496.
  26. ^Moolenaar, Bram."Vim: intro.txt".vimhelp.org. Retrieved1 September 2023.
  27. ^ab"CS107 The Vim Editor".web.stanford.edu.Archived from the original on 27 January 2023. Retrieved27 January 2023.
  28. ^Melendez, Steven (28 October 2014)."Why Vim, An '80s Text Editor, Is Still The UI Of Choice For Power Users".FastCompany.Archived from the original on 6 May 2019. Retrieved5 May 2019.
  29. ^"Tips: Making Vim easy".Linux.com. 10 April 2007.Archived from the original on 6 May 2019. Retrieved6 May 2019.
  30. ^"Vim documentation: usr_41".vimhelp.org.Archived from the original on 13 January 2019. Retrieved13 January 2019.
  31. ^Vim help system (type ":help" within Vim)
  32. ^"Vim documentation: recover".vimdoc.sourceforge.net.Archived from the original on 13 December 2020. Retrieved17 December 2020.
  33. ^"How to handle swapfiles in Vim".cs.longwood.edu.Archived from the original on 7 May 2021. Retrieved17 December 2020.
  34. ^"'swapfile' option".vimhelp.org. 10 October 2020.Archived from the original on 14 December 2020. Retrieved18 December 2020.
  35. ^The Open Group (2008),"vi — screen-oriented (visual) display editor", Single Unix Specification, Version 4 (IEEE Std 1003.1–2008),archived from the original on 22 January 2011, retrieved27 December 2010
  36. ^Peppe; Benji; Campbell, Charles (2 January 2004)."Vim FAQ".Archived from the original on 13 January 2019. Retrieved27 December 2010. (question 1.3)
  37. ^Klein, Benjamin."The VimL Primer: Edit Like a Pro with Vim Plugins and Scripts by Benjamin Klein | The Pragmatic Bookshelf". Archived fromthe original on 25 January 2020. Retrieved25 January 2020.
  38. ^"Vim documentation: usr_41".vimhelp.org.Archived from the original on 13 January 2019. Retrieved13 January 2019.
  39. ^Verdoolaege, Sven; Gerassimof, Matt."Vim documentation: if_perl".Archived from the original on 8 February 2012. Retrieved27 August 2019.
  40. ^Moore, Paul."Vim documentation: if_pyth".Archived from the original on 22 August 2012. Retrieved27 August 2019.
  41. ^Carvalho, Luis."Vim documentation: if_lua".Archived from the original on 30 March 2012. Retrieved27 August 2019.
  42. ^Maeda, Shugo."Vim documentation: if_ruby".Archived from the original on 14 February 2012. Retrieved27 August 2019.
  43. ^Wilken, Ingo."Vim documentation: if_tcl".Archived from the original on 24 August 2012. Retrieved27 August 2019.
  44. ^Khorev, Sergey."Vim documentation: if_mzsch".Archived from the original on 14 April 2012. Retrieved27 August 2019.
  45. ^"Filewatcher". Archived fromthe original on July 11, 2011. RetrievedFebruary 26, 2011.
  46. ^"Official Vim Manual, Version 4 summary". 12 March 2004.Archived from the original on 18 August 2008. Retrieved6 August 2008.
  47. ^"Official Vim Manual, Version 5 summary". 17 January 2004.Archived from the original on 21 August 2008. Retrieved6 August 2008.
  48. ^"Official Vim Manual, Version 6 summary". 12 March 2004.Archived from the original on 11 June 2008. Retrieved6 August 2008.
  49. ^"Vim Reference Manual, Version 7". 17 July 2016.Archived from the original on 13 January 2019. Retrieved13 January 2019.
  50. ^"Google Groups".groups.google.com.Archived from the original on 6 November 2012. Retrieved11 August 2008.
  51. ^Google DiscussiegroepenArchived 22 January 2011 at the Portuguese Web Archive. Groups.google.com. Retrieved on 2013-12-09.
  52. ^Bram Moolenaar."Vim 8.0 released!".Archived from the original on 22 January 2011. Retrieved12 September 2016.
  53. ^Bram Moolenaar."Vim 8.1 is released!".Archived from the original on 17 May 2018. Retrieved18 May 2018.
  54. ^Bram Moolenaar."Vim 8.2 is released!".Archived from the original on 12 December 2019. Retrieved13 December 2019.
  55. ^Bram Moolenaar."Vim 9.0 is released!".Archived from the original on 2 July 2022. Retrieved30 June 2022.
  56. ^Christian Brabandt."Vim 9.1 is released!".Archived from the original on 2 January 2024. Retrieved4 January 2024.
  57. ^Christian Brabandt."Vim 9.2 has been released!".Archived from the original on 14 February 2026. Retrieved16 February 2026.

External links

[edit]
The WikibookLearning the vi Editor has a page on the topic of:Vim
Wikimedia Commons has media related toVim.
General
Software
packages
Community
Organisations
Licenses
Types and
standards
Challenges
Related
topics
Open-source
CodeMirror-based
Mozilla Composer-based
Scintilla-based
Web-based
Freeware
Commercial
software
Cross-platform
macOS only
Windows only
Discontinued
Helper tools
C,C++
Open source
Freeware
Retail
Discontinued
Java
Open source
Freeware
Retail
Discontinued
JavaScript
Open source
Haxe
CLI (.NET)
Open source
Freeware
Retail
Discontinued
Flash
PHP
Open source
Proprietary
R
Python
Open source
Proprietary
Pascal,
Object
Pascal
Open source
Freeware
Retail
Discontinued
BASIC
Open source
Freeware
Retail
Discontinued
Go
Open source
Freeware
Retail
Eiffel
POP-11
Online
International
National
Retrieved from "https://en.wikipedia.org/w/index.php?title=Vim_(text_editor)&oldid=1338619398"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp