Name Date Size #Lines LOC

..21-Oct-2025-

.github/H25-Jul-2025-1,029936

READMEdir/H25-Jul-2025-552394

ci/H25-Jul-2025-148107

nsis/H25-Jul-2025-4,1333,263

pixmaps/H25-Jul-2025-1,7131,564

runtime/H25-Jul-2025-593,274496,365

src/H25-Jul-2025-1,005,478771,880

tools/H25-Jul-2025-76

.appveyor.ymlH A D25-Jul-2025733 3527

.cirrus.ymlH A D25-Jul-2025518 2220

.codecov.ymlH A D25-Jul-202593 76

.coveralls.ymlH A D25-Jul-202529 21

.gitattributesH A D25-Jul-202527 21

.gitignoreH A D25-Jul-20251.5 KiB10191

.lgtm.ymlH A D25-Jul-2025140 54

.travis.ymlH A D25-Jul-20258.9 KiB289277

CONTRIBUTING.mdH A D25-Jul-20253.5 KiB8861

FilelistH A D25-Jul-202525.2 KiB1,0641,023

LICENSEH A D25-Jul-20254.9 KiB7974

MakefileH A D25-Jul-202520.6 KiB572297

README.mdH A D25-Jul-20257 KiB158105

README.txtH A D25-Jul-20254.8 KiB13488

README_VIM9.mdH A D25-Jul-202510.6 KiB355289

configureH A D25-Jul-2025182 71

uninstall.txtH A D25-Jul-20253.8 KiB7861

vimtutor.batH A D25-Jul-20251.7 KiB6952

vimtutor.comH A D25-Jul-20252.8 KiB105104

README.md

1[![Vim Logo](https://github.com/vim/vim/raw/master/runtime/vimlogo.gif)](https://www.vim.org)
2
3[![Github Build status](https://github.com/vim/vim/workflows/GitHub%20CI/badge.svg)](https://github.com/vim/vim/actions?query=workflow%3A%22GitHub+CI%22) [![Travis Build Status](https://travis-ci.com/vim/vim.svg?branch=master)](https://travis-ci.com/github/vim/vim) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim) [![Cirrus Build Status](https://api.cirrus-ci.com/github/vim/vim.svg)](https://cirrus-ci.com/github/vim/vim) [![Coverage Status](https://codecov.io/gh/vim/vim/coverage.svg?branch=master)](https://codecov.io/gh/vim/vim?branch=master) [![Coverity Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim) [![Language Grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/vim/vim.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/vim/vim/context:cpp) [![Debian CI](https://badges.debian.net/badges/debian/testing/vim/version.svg)](https://buildd.debian.org/vim) [![Packages](https://repology.org/badge/tiny-repos/vim.svg)](https://repology.org/metapackage/vim) [![Fossies codespell report](https://fossies.org/linux/test/vim-master.tar.gz/codespell.svg)](https://fossies.org/linux/test/vim-master.tar.gz/codespell.html)
4
5<sub>For translations of this README see the end.</sub>
6
7If you find a bug or want to discuss the best way to add a new feature, please
8open an [issue](https://github.com/vim/vim/issues).
9If you have a question or want to discuss the best way to do something with
10Vim, you can use [StackExchange](https://vi.stackexchange.com/)
11or one of the [Maillists](https://www.vim.org/community.php).
12
13
14## What is Vim? ##
15
16Vim is a greatly improved version of the good old UNIX editor
17[Vi](https://en.wikipedia.org/wiki/Vi).  Many new
18features have been added: multi-level undo, syntax highlighting, command line
19history, on-line help, spell checking, filename completion, block operations,
20script language, etc.  There is also a Graphical User Interface (GUI)
21available.  Still, Vi compatibility is maintained, those who have Vi "in the
22fingers" will feel at home.
23See [`runtime/doc/vi_diff.txt`](runtime/doc/vi_diff.txt) for differences with
24Vi.
25
26This editor is very useful for editing programs and other plain text files.
27All commands are given with normal keyboard characters, so those who can type
28with ten fingers can work very fast.  Additionally, function keys can be
29mapped to commands by the user, and the mouse can be used.
30
31Vim runs under MS-Windows (XP, Vista, 7, 8, 10), macOS, Haiku, VMS and almost
32all flavours of UNIX.  Porting to other systems should not be very difficult.
33Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000, Amiga DOS,
34Atari MiNT, BeOS, RISC OS and OS/2.  These are no longer maintained.
35
36For Vim9 script see [README_VIM9](README_VIM9.md).
37
38## Distribution ##
39
40You can often use your favorite package manager to install Vim.  On Mac and
41Linux a small version of Vim is pre-installed, you still need to install Vim
42if you want more features.
43
44There are separate distributions for Unix, PC, Amiga and some other systems.
45This `README.md` file comes with the runtime archive.  It includes the
46documentation, syntax files and other files that are used at runtime.  To run
47Vim you must get either one of the binary archives or a source archive.
48Which one you need depends on the system you want to run it on and whether you
49want or must compile it yourself.  Check https://www.vim.org/download.php for
50an overview of currently available distributions.
51
52Some popular places to get the latest Vim:
53* Check out the git repository from [GitHub](https://github.com/vim/vim).
54* Get the source code as an [archive](https://github.com/vim/vim/releases).
55* Get a Windows executable from the
56[vim-win32-installer](https://github.com/vim/vim-win32-installer/releases) repository.
57
58
59
60## Compiling ##
61
62If you obtained a binary distribution you don't need to compile Vim.  If you
63obtained a source distribution, all the stuff for compiling Vim is in the
64[`src`](/src) directory.  See [`src/INSTALL`](src/INSTALL) for instructions.
65
66
67## Installation ##
68
69See one of these files for system-specific instructions.  Either in the
70[READMEdir directory](./READMEdir/) (in the repository) or
71the top directory (if you unpack an archive):
72
73	README_ami.txt		Amiga
74	README_unix.txt		Unix
75	README_dos.txt		MS-DOS and MS-Windows
76	README_mac.txt		Macintosh
77	README_haiku.txt	Haiku
78	README_vms.txt		VMS
79
80There are other `README_*.txt` files, depending on the distribution you used.
81
82
83## Documentation ##
84
85The Vim tutor is a one hour training course for beginners.  Often it can be
86started as `vimtutor`.  See `:help tutor` for more information.
87
88The best is to use `:help` in Vim.  If you don't have an executable yet, read
89[`runtime/doc/help.txt`](/runtime/doc/help.txt).
90It contains pointers to the other documentation files.
91The User Manual reads like a book and is recommended to learn to use
92Vim.  See `:help user-manual`.
93
94
95## Copying ##
96
97Vim is Charityware.  You can use and copy it as much as you like, but you are
98encouraged to make a donation to help orphans in Uganda.  Please read the file
99[`runtime/doc/uganda.txt`](runtime/doc/uganda.txt)
100for details (do `:help uganda` inside Vim).
101
102Summary of the license: There are no restrictions on using or distributing an
103unmodified copy of Vim.  Parts of Vim may also be distributed, but the license
104text must always be included.  For modified versions a few restrictions apply.
105The license is GPL compatible, you may compile Vim with GPL libraries and
106distribute it.
107
108
109## Sponsoring ##
110
111Fixing bugs and adding new features takes a lot of time and effort.  To show
112your appreciation for the work and motivate Bram and others to continue
113working on Vim please send a donation.
114
115Since Bram is back to a paid job the money will now be used to help children
116in Uganda.  See [`runtime/doc/uganda.txt`](runtime/doc/uganda.txt).  But
117at the same time donations increase Bram's motivation to keep working on Vim!
118
119For the most recent information about sponsoring look on the Vim web site:
120	https://www.vim.org/sponsor/
121
122
123## Contributing ##
124
125If you would like to help making Vim better, see the
126[CONTRIBUTING.md](/CONTRIBUTING.md) file.
127
128
129## Information ##
130
131The latest news about Vim can be found on the Vim home page:
132	https://www.vim.org/
133
134If you have problems, have a look at the Vim documentation or tips:
135	https://www.vim.org/docs.php
136	https://vim.fandom.com/wiki/Vim_Tips_Wiki
137
138If you still have problems or any other questions, use one of the mailing
139lists to discuss them with Vim users and developers:
140	https://www.vim.org/maillist.php
141
142If nothing else works, report bugs directly:
143	Bram Moolenaar <[email protected]>
144
145
146## Main author ##
147
148Send any other comments, patches, flowers and suggestions to:
149	Bram Moolenaar <[email protected]>
150
151
152This is `README.md` for version 8.2 of Vim: Vi IMproved.
153
154
155## Translations of this README ##
156
157[Korean](https://github.com/cjw1359/opensource/blob/master/Vim/README_ko.md)
158

README.txt

1README.txt for version 8.2 of Vim: Vi IMproved.
2
3
4WHAT IS VIM?
5
6Vim is a greatly improved version of the good old UNIX editor Vi.  Many new
7features have been added: multi-level undo, syntax highlighting, command line
8history, on-line help, spell checking, filename completion, block operations,
9script language, etc.  There is also a Graphical User Interface (GUI)
10available.  Still, Vi compatibility is maintained, those who have Vi "in the
11fingers" will feel at home.  See "runtime/doc/vi_diff.txt" for differences with
12Vi.
13
14This editor is very useful for editing programs and other plain text files.
15All commands are given with normal keyboard characters, so those who can type
16with ten fingers can work very fast.  Additionally, function keys can be
17mapped to commands by the user, and the mouse can be used.
18
19Vim runs under MS-Windows (XP, Vista, 7, 8, 10), macOS, VMS and almost all
20flavours of UNIX.  Porting to other systems should not be very difficult.
21Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000, Amiga DOS,
22Atari MiNT, BeOS, RISC OS and OS/2.  These are no longer maintained.
23
24
25DISTRIBUTION
26
27You can often use your favorite package manager to install Vim.  On Mac and
28Linux a small version of Vim is pre-installed, you still need to install Vim
29if you want more features.
30
31There are separate distributions for Unix, PC, Amiga and some other systems.
32This README.txt file comes with the runtime archive.  It includes the
33documentation, syntax files and other files that are used at runtime.  To run
34Vim you must get either one of the binary archives or a source archive.
35Which one you need depends on the system you want to run it on and whether you
36want or must compile it yourself.  Check "https://www.vim.org/download.php" for
37an overview of currently available distributions.
38
39Some popular places to get the latest Vim:
40* Check out the git repository from github: https://github.com/vim/vim.
41* Get the source code as an archive: https://github.com/vim/vim/releases.
42* Get a Windows executable from the vim-win32-installer repository:
43  https://github.com/vim/vim-win32-installer/releases.
44
45
46COMPILING
47
48If you obtained a binary distribution you don't need to compile Vim.  If you
49obtained a source distribution, all the stuff for compiling Vim is in the
50"src" directory.  See src/INSTALL for instructions.
51
52
53INSTALLATION
54
55See one of these files for system-specific instructions.  Either in the
56READMEdir directory (in the repository) or the top directory (if you unpack an
57archive):
58
59README_ami.txt		Amiga
60README_unix.txt		Unix
61README_dos.txt		MS-DOS and MS-Windows
62README_mac.txt		Macintosh
63README_vms.txt		VMS
64
65There are more README_*.txt files, depending on the distribution you used.
66
67
68DOCUMENTATION
69
70The Vim tutor is a one hour training course for beginners.  Often it can be
71started as "vimtutor".  See ":help tutor" for more information.
72
73The best is to use ":help" in Vim.  If you don't have an executable yet, read
74"runtime/doc/help.txt".  It contains pointers to the other documentation
75files.  The User Manual reads like a book and is recommended to learn to use
76Vim.  See ":help user-manual".
77
78
79COPYING
80
81Vim is Charityware.  You can use and copy it as much as you like, but you are
82encouraged to make a donation to help orphans in Uganda.  Please read the file
83"runtime/doc/uganda.txt" for details (do ":help uganda" inside Vim).
84
85Summary of the license: There are no restrictions on using or distributing an
86unmodified copy of Vim.  Parts of Vim may also be distributed, but the license
87text must always be included.  For modified versions a few restrictions apply.
88The license is GPL compatible, you may compile Vim with GPL libraries and
89distribute it.
90
91
92SPONSORING
93
94Fixing bugs and adding new features takes a lot of time and effort.  To show
95your appreciation for the work and motivate Bram and others to continue
96working on Vim please send a donation.
97
98Since Bram is back to a paid job the money will now be used to help children
99in Uganda.  See runtime/doc/uganda.txt.  But at the same time donations
100increase Bram's motivation to keep working on Vim!
101
102For the most recent information about sponsoring look on the Vim web site:
103
104	https://www.vim.org/sponsor/
105
106
107CONTRIBUTING
108
109If you would like to help making Vim better, see the CONTRIBUTING.md file.
110
111
112INFORMATION
113
114The latest news about Vim can be found on the Vim home page:
115	https://www.vim.org/
116
117If you have problems, have a look at the Vim documentation or tips:
118	https://www.vim.org/docs.php
119	https://vim.fandom.com/wiki/Vim_Tips_Wiki
120
121If you still have problems or any other questions, use one of the mailing
122lists to discuss them with Vim users and developers:
123	https://www.vim.org/maillist.php
124
125If nothing else works, report bugs directly:
126	Bram Moolenaar <[email protected]>
127
128
129MAIN AUTHOR
130
131Send any other comments, patches, flowers and suggestions to:
132
133	Bram Moolenaar		E-mail:	[email protected]
134

README_VIM9.md

1![Vim Logo](https://github.com/vim/vim/blob/master/runtime/vimlogo.gif)
2
3# What is Vim9?
4
5This is an experimental side of [Vim](https://github.com/vim/vim).
6It explores ways of making Vim script faster and better.
7
8WARNING: The Vim9 script features are still under development, anything can
9break!
10
11# Why Vim9?
12
13## 1. FASTER VIM SCRIPT
14
15The third item on the poll results of 2018, after popup windows and text
16properties, is faster Vim script.  So how do we do that?
17
18I have been throwing some ideas around, and soon came to the conclusion
19that the current way functions are called and executed, with
20dictionaries for the arguments and local variables, is never going to be
21very fast.  We're lucky if we can make it twice as fast.  The overhead
22of a function call and executing every line is just too high.
23
24So what then?  We can only make something fast by having a new way of
25defining a function, with similar but different properties of the old
26way:
27* Arguments are only available by name, not through the a: dictionary or
28  the a:000 list.
29* Local variables are not available in an l: dictionary.
30* A few more things that slow us down, such as exception handling details.
31
32I Implemented a "proof of concept" and measured the time to run a simple
33for loop with an addition (Justin used this example in his presentation,
34full code is below):
35
36``` vim
37  let sum = 0
38  for i in range(1, 2999999)
39    let sum += i
40  endfor
41```
42
43| how     | time in sec |
44| --------| -------- |
45| Vim old | 5.018541 |
46| Python  | 0.369598 |
47| Lua     | 0.078817 |
48| LuaJit  | 0.004245 |
49| Vim new | 0.073595 |
50
51That looks very promising!  It's just one example, but it shows how much
52we can gain, and also that Vim script can be faster than builtin
53interfaces.
54
55LuaJit is much faster at Lua-only instructions.  In practice the script would
56not do something useless as counting but change the text.  For example,
57reindent all the lines:
58
59``` vim
60  let totallen = 0
61  for i in range(1, 100000)
62    call setline(i, '    ' .. getline(i))
63    let totallen += len(getline(i))
64  endfor
65```
66
67| how     | time in sec |
68| --------| -------- |
69| Vim old | 0.578598 |
70| Python  | 0.152040 |
71| Lua     | 0.164917 |
72| LuaJit  | 0.128400 |
73| Vim new | 0.079692 |
74
75[These times were measured on a different system by Dominique Pelle]
76
77The differences are smaller, but Vim 9 script is clearly the fastest.
78Using LuaJIT is only a little bit faster than plain Lua here, clearly the call
79back to the Vim code is costly.
80
81How does Vim9 script work?  The function is first compiled into a sequence of
82instructions.  Each instruction has one or two parameters and a stack is
83used to store intermediate results.  Local variables are also on the
84stack, space is reserved during compilation.  This is a fairly normal
85way of compilation into an intermediate format, specialized for Vim,
86e.g. each stack item is a typeval_T.  And one of the instructions is
87"execute Ex command", for commands that are not compiled.
88
89
90## 2. DEPRIORITIZE INTERFACES
91
92Attempts have been made to implement functionality with built-in script
93languages such as Python, Perl, Lua, Tcl and Ruby.  This never gained much
94foothold, for various reasons.
95
96Instead of using script language support in Vim:
97* Encourage implementing external tools in any language and communicate
98  with them.  The job and channel support already makes this possible.
99  Really any language can be used, also Java and Go, which are not
100  available built-in.
101* No priority for the built-in language interfaces.  They will have to be kept
102  for backwards compatibility, but many users won't need a Vim build with these
103  interfaces.
104* Improve the Vim script language, it is used to communicate with the external
105  tool and implements the Vim side of the interface.  Also, it can be used when
106  an external tool is undesired.
107
108Altogether this creates a clear situation: Vim with the +eval feature
109will be sufficient for most plugins, while some plugins require
110installing a tool that can be written in any language.  No confusion
111about having Vim but the plugin not working because some specific
112language is missing.  This is a good long term goal.
113
114Rationale: Why is it better to run a tool separately from Vim than using a
115built-in interface and interpreter?  Take for example something that is
116written in Python:
117* The built-in interface uses the embedded python interpreter.  This is less
118  well maintained than the python command.  Building Vim with it requires
119  installing developer packages.  If loaded dynamically there can be a version
120  mismatch.
121* When running the tool externally the standard python command can be used,
122  which is quite often available by default or can be easily installed.
123* The built-in interface has an API that is unique for Vim with Python. This is
124  an extra API to learn.
125* A .py file can be compiled into a .pyc file and execute much faster.
126* Inside Vim multi-threading can cause problems, since the Vim core is single
127  threaded.  In an external tool there are no such problems.
128* The Vim part is written in .vim files, the Python part is in .py files, this
129  is nicely separated.
130* Disadvantage: An interface needs to be made between Vim and Python.
131  JSON is available for this, and it's fairly easy to use.  But it still
132  requires implementing asynchronous communication.
133
134
135## 3. BETTER VIM SCRIPT
136
137To make Vim faster a new way of defining a function needs to be added.
138While we are doing that, since the lines in this function won't be fully
139backwards compatible anyway, we can also make Vim script easier to use.
140In other words: "less weird".  Making it work more like modern
141programming languages will help.  No surprises.
142
143A good example is how in a function the arguments are prefixed with
144"a:". No other language I know does that, so let's drop it.
145
146Taking this one step further is also dropping "s:" for script-local variables;
147everything at the script level is script-local by default.  Since this is not
148backwards compatible it requires a new script style: Vim9 script!
149
150To avoid having more variations, the syntax inside a compiled function is the
151same as in Vim9 script.  Thus you have legacy syntax and Vim9 syntax.
152
153It should be possible to convert code from other languages to Vim
154script.  We can add functionality to make this easier.  This still needs
155to be discussed, but we can consider adding type checking and a simple
156form of classes.  If you look at JavaScript for example, it has gone
157through these stages over time, adding real class support and now
158TypeScript adds type checking.  But we'll have to see how much of that
159we actually want to include in Vim script.  Ideally a conversion tool
160can take Python, JavaScript or TypeScript code and convert it to Vim
161script, with only some things that cannot be converted.
162
163Vim script won't work the same as any specific language, but we can use
164mechanisms that are commonly known, ideally with the same syntax.  One
165thing I have been thinking of is assignments without ":let".  I often
166make that mistake (after writing JavaScript especially).  I think it is
167possible, if we make local variables shadow commands.  That should be OK,
168if you shadow a command you want to use, just rename the variable.
169Using "var" and "const" to declare a variable, like in JavaScript and
170TypeScript, can work:
171
172
173``` vim
174def MyFunction(arg: number): number
175   var local = 1
176   var todo = arg
177   const ADD = 88
178   while todo > 0
179      local += ADD
180      todo -= 1
181   endwhile
182   return local
183enddef
184```
185
186The similarity with JavaScript/TypeScript can also be used for dependencies
187between files.  Vim currently uses the `:source` command, which has several
188disadvantages:
189*   In the sourced script, is not clear what it provides.  By default all
190    functions are global and can be used elsewhere.
191*   In a script that sources other scripts, it is not clear what function comes
192    from what sourced script.  Finding the implementation is a hassle.
193*   Prevention of loading the whole script twice must be manually implemented.
194
195We can use the `:import` and `:export` commands from the JavaScript standard to
196make this much better.  For example, in script "myfunction.vim" define a
197function and export it:
198
199``` vim
200vim9script  " Vim9 script syntax used here
201
202var local = 'local variable is not exported, script-local'
203
204export def MyFunction()  " exported function
205...
206
207def LocalFunction() " not exported, script-local
208...
209```
210
211And in another script import the function:
212
213``` vim
214vim9script  " Vim9 script syntax used here
215
216import MyFunction from 'myfunction.vim'
217```
218
219This looks like JavaScript/TypeScript, thus many users will understand the
220syntax.
221
222These are ideas, this will take time to design, discuss and implement.
223Eventually this will lead to Vim 9!
224
225
226## Code for sum time measurements
227
228Vim was build with -O2.
229
230``` vim
231func VimOld()
232  let sum = 0
233  for i in range(1, 2999999)
234    let sum += i
235  endfor
236  return sum
237endfunc
238
239func Python()
240  py3 << END
241sum = 0
242for i in range(1, 3000000):
243  sum += i
244END
245  return py3eval('sum')
246endfunc
247
248func Lua()
249  lua << END
250    sum = 0
251    for i = 1, 2999999 do
252      sum = sum + i
253    end
254END
255  return luaeval('sum')
256endfunc
257
258def VimNew(): number
259  var sum = 0
260  for i in range(1, 2999999)
261    sum += i
262  endfor
263  return sum
264enddef
265
266let start = reltime()
267echo VimOld()
268echo 'Vim old: ' .. reltimestr(reltime(start))
269
270let start = reltime()
271echo Python()
272echo 'Python: ' .. reltimestr(reltime(start))
273
274let start = reltime()
275echo Lua()
276echo 'Lua: ' .. reltimestr(reltime(start))
277
278let start = reltime()
279echo VimNew()
280echo 'Vim new: ' .. reltimestr(reltime(start))
281```
282
283## Code for indent time measurements
284
285``` vim
286def VimNew(): number
287  var totallen = 0
288  for i in range(1, 100000)
289    setline(i, '    ' .. getline(i))
290    totallen += len(getline(i))
291  endfor
292  return totallen
293enddef
294
295func VimOld()
296  let totallen = 0
297  for i in range(1, 100000)
298    call setline(i, '    ' .. getline(i))
299    let totallen += len(getline(i))
300  endfor
301  return totallen
302endfunc
303
304func Lua()
305  lua << END
306    b = vim.buffer()
307    totallen = 0
308    for i = 1, 100000 do
309      b[i] = "    " .. b[i]
310      totallen = totallen + string.len(b[i])
311    end
312END
313  return luaeval('totallen')
314endfunc
315
316func Python()
317  py3 << END
318cb = vim.current.buffer
319totallen = 0
320for i in range(0, 100000):
321  cb[i] = '    ' + cb[i]
322  totallen += len(cb[i])
323END
324  return py3eval('totallen')
325endfunc
326
327new
328call setline(1, range(100000))
329let start = reltime()
330echo VimOld()
331echo 'Vim old: ' .. reltimestr(reltime(start))
332bwipe!
333
334new
335call setline(1, range(100000))
336let start = reltime()
337echo Python()
338echo 'Python: ' .. reltimestr(reltime(start))
339bwipe!
340
341new
342call setline(1, range(100000))
343let start = reltime()
344echo Lua()
345echo 'Lua: ' .. reltimestr(reltime(start))
346bwipe!
347
348new
349call setline(1, range(100000))
350let start = reltime()
351echo VimNew()
352echo 'Vim new: ' .. reltimestr(reltime(start))
353bwipe!
354```
355