Skip to content
Branch: master
Find file History
ychin Merge pull request #943 from ychin/macvim-tests
Add MacVim test scripts for basic testing
Latest commit dc07a14 Oct 8, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
GvimExt patch 8.1.2086: missing a few changes for the renamed files Sep 27, 2019
MacVim [fix #766] Add a variable (and an event) for OS appearance (change) Oct 6, 2019
VisVim patch 8.1.1183: typos in VisVim comments Apr 17, 2019
auto Merge remote-tracking branch 'vim/master' Sep 23, 2019
create-dmg Add DMG background source in pixlr.com format Jul 18, 2015
if_perl_msvc patch 7.4.1011 Dec 31, 2015
libvterm patch 8.1.2076: crash when trying to put a terminal in a popup window Sep 25, 2019
os_mac_rsrc updated for version 7.0d01 Apr 11, 2006
po Update runtime files. Sep 27, 2019
proto Merge remote-tracking branch 'vim/master' Sep 30, 2019
tee patch 8.1.0500: cleaning up in src/tee may not always work Oct 28, 2018
testdir Merge pull request #943 from ychin/macvim-tests Oct 8, 2019
xdiff patch 8.1.0766: various problems when using Vim on VMS Jan 17, 2019
xpm patch 8.1.1119: no support for Windows on ARM64. Apr 4, 2019
xxd patch 8.1.1306: Borland support is outdated and doesn't work May 9, 2019
INSTALL patch 8.1.0528: various typos in comments Nov 16, 2018
INSTALLami.txt updated for version 7.0001 Jun 13, 2004
INSTALLmac.txt patch 7.4.1043 Jan 3, 2016
INSTALLpc.txt
INSTALLvms.txt updated for version 7.3.925 May 6, 2013
INSTALLx.txt First step in the Vim 7.3 branch. Changed version numbers. May 15, 2010
Make_all.mak patch 8.1.0723: cannot easily run specific test when in src/testdir Jan 11, 2019
Make_cyg.mak patch 8.1.1104: MS-Windows: not all environment variables can be used Apr 3, 2019
Make_cyg_ming.mak patch 8.1.2094: the fileio.c file is too big Sep 28, 2019
Make_ming.mak patch 8.0.1141: MS-Windows build dependencies are incomplete Sep 23, 2017
Make_mint.mak updated for version 7.2a Jun 24, 2008
Make_morph.mak patch 8.1.2094: the fileio.c file is too big Sep 28, 2019
Make_mvc.mak patch 8.1.2094: the fileio.c file is too big Sep 28, 2019
Make_vms.mms patch 8.1.2094: the fileio.c file is too big Sep 28, 2019
Makefile Merge remote-tracking branch 'vim/master' Sep 30, 2019
README.md patch 8.1.2094: the fileio.c file is too big Sep 28, 2019
alloc.h patch 8.1.0614: placing signs can be complicated Dec 21, 2018
arabic.c patch 8.1.1085: compiler warning for possibly uninitialized variable Mar 30, 2019
arglist.c patch 8.1.1887: the +cmdline_compl feature is not in the tiny version Aug 18, 2019
ascii.h patch 7.4.2293 Aug 29, 2016
autocmd.c [fix #766] Add a variable (and an event) for OS appearance (change) Oct 6, 2019
beval.c patch 8.1.1751: when redrawing popups plines_win() may be called often Jul 26, 2019
beval.h Merge remote-tracking branch 'vim/master' May 23, 2019
bigvim.bat patch 8.0.1385: Python 3.5 is getting old Dec 10, 2017
bigvim64.bat patch 7.4.2302 Sep 1, 2016
blob.c patch 8.1.1763: evalfunc.c is still too big Jul 27, 2019
blowfish.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
buffer.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
bufwrite.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
change.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
channel.c
charset.c patch 8.1.2036: the str2nr() tests fail Sep 15, 2019
cmdexpand.c Merge remote-tracking branch 'vim/master' Sep 4, 2019
cmdhist.c patch 8.1.1887: the +cmdline_compl feature is not in the tiny version Aug 18, 2019
config.h.in patch 8.1.1567: localtime_r() does not respond to $TZ changes Jun 18, 2019
config.mk.dist patch 8.0.0573: running parallel make after distclean fails Apr 20, 2017
config.mk.in Merge remote-tracking branch 'vim/master' Apr 22, 2019
configure Restore 'src/configure' script from upstream Jun 23, 2013
configure.ac Merge remote-tracking branch 'vim/master' Sep 23, 2019
create_cmdidxs.vim patch 8.1.1672: "make cmdidxs" doesn't work Jul 12, 2019
crypt.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
crypt_zip.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
debugger.c patch 8.1.1384: using "int" for alloc() often results in compiler war… May 24, 2019
dehqx.py patch 8.0.1648: resource fork tool doesn't work on Python 3 Mar 27, 2018
dict.c patch 8.1.2095: leaking memory when getting item from dict Sep 28, 2019
diff.c patch 8.1.1989: the evalfunc.c file is still too big Sep 5, 2019
digraph.c patch 8.1.1923: some source files are not in a normal encoding Aug 24, 2019
dimm.idl updated for version 7.0001 Jun 13, 2004
dlldata.c updated for version 7.0001 Jun 13, 2004
dosinst.c patch 8.1.2082: some files have a weird name to fit in 8.3 characters Sep 27, 2019
dosinst.h patch 8.1.2082: some files have a weird name to fit in 8.3 characters Sep 27, 2019
drawline.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
drawscreen.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
edit.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
eval.c patch 8.1.2035: recognizing octal numbers is confusing Sep 15, 2019
evalbuffer.c patch 8.1.2001: some source files are too big Sep 7, 2019
evalfunc.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
evalvars.c [fix #766] Add a variable (and an event) for OS appearance (change) Oct 6, 2019
evalwindow.c patch 8.1.2037: can call win_gotoid() in cmdline window Sep 15, 2019
ex_cmdidxs.h Merge remote-tracking branch 'vim/master' Sep 4, 2019
ex_cmds.c
ex_cmds.h Merge remote-tracking branch 'vim/master' Sep 23, 2019
ex_cmds2.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
ex_docmd.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
ex_eval.c patch 8.1.1891: functions used in one file are global Aug 20, 2019
ex_getln.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
feature.h Merge remote-tracking branch 'vim/master' Sep 30, 2019
fileio.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
filepath.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
findfile.c patch 8.1.1979: code for handling file names is spread out Sep 4, 2019
fold.c patch 8.1.2096: too many #ifdefs Sep 28, 2019
getchar.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
glbl_ime.cpp patch 8.1.1103: MS-Windows: old API calls are no longer needed Apr 2, 2019
glbl_ime.h patch 7.4.2293 Aug 29, 2016
globals.h
gui.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
gui.h Merge remote-tracking branch 'vim/master' Jul 7, 2019
gui_at_fs.c patch 8.1.1384: using "int" for alloc() often results in compiler war… May 24, 2019
gui_at_sb.c patch 8.1.0743: giving error messages is not flexible Jan 13, 2019
gui_at_sb.h patch 7.4.2293 Aug 29, 2016
gui_athena.c patch 8.1.0528: various typos in comments Nov 16, 2018
gui_beval.c Merge remote-tracking branch 'vim/master' Jul 7, 2019
gui_dwrite.cpp patch 8.1.1273: compiler warning in direct write code May 5, 2019
gui_dwrite.h patch 8.0.1449: slow redrawing with DirectX Jan 31, 2018
gui_gtk.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
gui_gtk_f.c patch 8.1.1219: not checking for NULL return from alloc() Apr 27, 2019
gui_gtk_f.h patch 8.0.0521: GtkForm handling is outdated Mar 29, 2017
gui_gtk_res.xml patch 7.4.1019 Jan 1, 2016
gui_gtk_vms.h patch 7.4.2293 Aug 29, 2016
gui_gtk_x11.c patch 8.1.2034: dark them of GTK 3 not supported Sep 15, 2019
gui_mac.c
gui_motif.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
gui_photon.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
gui_w32.c patch 8.1.2064: MS-Windows: compiler warnings for unused arguments Sep 21, 2019
gui_w32_rc.h updated for version 7.0001 Jun 13, 2004
gui_x11.c patch 8.1.1531: clipboard type name is inconsistent Jun 14, 2019
gui_x11_pm.h
gui_xmdlg.c patch 8.0.0367: types in include files may be inconsistent Feb 25, 2017
gui_xmebw.c patch 8.1.0766: various problems when using Vim on VMS Jan 17, 2019
gui_xmebw.h patch 7.4.2293 Aug 29, 2016
gui_xmebwp.h
gvim.exe.mnf Vim 8.1 release May 17, 2018
gvimtutor updated for version 7.1-298 May 10, 2008
hangulin.c patch 8.1.2021: some global functions can be local to the file Sep 10, 2019
hardcopy.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
hashtab.c patch 8.1.1752: resizing hashtable is inefficient Jul 26, 2019
highlight.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
if_cscope.c patch 8.1.1991: still cannot build with eval but without cscope Sep 5, 2019
if_cscope.h patch 8.1.0941: macros for MS-Windows are inconsistent Feb 17, 2019
if_lua.c patch 8.1.1583: set_ref_in_list() only sets ref in items Jun 22, 2019
if_mzsch.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
if_mzsch.h patch 7.4.2293 Aug 29, 2016
if_ole.cpp patch 8.1.1393: unnecessary type casts May 25, 2019
if_ole.h updated for version 7.3.199 May 25, 2011
if_ole.idl updated for version 7.1-282 Mar 16, 2008
if_perl.xs patch 8.1.0978: blob not tested with Perl Feb 23, 2019
if_perlsfio.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
if_py_both.h patch 8.1.1957: more code can be moved to evalvars.c Sep 1, 2019
if_python.c Merge remote-tracking branch 'vim/master' Mar 23, 2019
if_python3.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
if_ruby.c patch 8.1.1174: cannot build with Ruby 1.8 Apr 14, 2019
if_tcl.c patch 8.1.1086: too many curly braces Mar 30, 2019
if_xcmdsrv.c Merge remote-tracking branch 'vim/master' Jun 3, 2019
iid_ole.c updated for version 7.1-065 Aug 12, 2007
indent.c patch 8.1.1966: some code in options.c fits better elsewhere Sep 2, 2019
infplist.xml updated for version 7.0c10 Apr 5, 2006
insexpand.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
install-sh patch 8.0.0570: can't run make with several jobs Apr 20, 2017
installman.sh patch 8.1.1194: typos and small problems in source files Apr 20, 2019
installml.sh patch 8.0.0576: can't build when configure choses "install-sh" Apr 21, 2017
iscygpty.c patch 8.0.1550: various small problems in source files Feb 27, 2018
iscygpty.h patch 8.0.1030: MS-Windows: wrong size computation in is_cygpty() Aug 31, 2017
json.c patch 8.1.1891: functions used in one file are global Aug 20, 2019
json_test.c
keymap.h Merge remote-tracking branch 'vim/master' May 5, 2019
kword_test.c patch 8.1.0806: too many #ifdefs Jan 24, 2019
link.390
link.sh updated for version 7.3.050 Nov 3, 2010
list.c patch 8.1.1981: the evalfunc.c file is too big Sep 4, 2019
macros.h patch 8.1.1555: NOT_IN_POPUP_WINDOW is confusing Jun 16, 2019
main.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
map.c Merge remote-tracking branch 'vim/master' Sep 4, 2019
mark.c patch 8.1.2058: function for ex command is named inconsistently Sep 19, 2019
mbyte.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
memfile.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
memfile_test.c patch 8.1.1465: allocating wrong amount of memory Jun 4, 2019
memline.c patch 8.1.2064: MS-Windows: compiler warnings for unused arguments Sep 21, 2019
menu.c Merge remote-tracking branch 'vim/master' Sep 4, 2019
message.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
message_test.c patch 8.0.0540: building unit tests fails Apr 2, 2017
misc1.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
misc2.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
mouse.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
move.c Merge remote-tracking branch 'vim/master' Sep 4, 2019
msvc2008.bat updated for version 7.3.1308 Jul 4, 2013
msvc2010.bat updated for version 7.3.1308 Jul 4, 2013
msvc2015.bat patch 8.1.0408: MSVC: cannot use the "x64" native compiler option Sep 18, 2018
msvcsetup.bat updated for version 7.0216 Mar 6, 2006
msys32.bat patch 8.1.0128: building with MinGW does not work out-of-the-box Jun 30, 2018
msys64.bat patch 8.1.0128: building with MinGW does not work out-of-the-box Jun 30, 2018
mysign patch 8.0.0082 Nov 12, 2016
nbdebug.c patch 8.1.1313: warnings for using localtime() and ctime() May 10, 2019
nbdebug.h patch 8.1.0944: format of nbdbg() arguments is not checked Feb 17, 2019
netbeans.c Merge remote-tracking branch 'vim/master' Sep 4, 2019
normal.c
ops.c patch 8.1.2096: too many #ifdefs Sep 28, 2019
option.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
option.h Merge remote-tracking branch 'vim/master' Sep 30, 2019
optiondefs.h Merge remote-tracking branch 'vim/master' Sep 30, 2019
optionstr.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
os_amiga.c patch 8.1.2084: Amiga: cannot get the user name Sep 27, 2019
os_amiga.h patch 8.1.2084: Amiga: cannot get the user name Sep 27, 2019
os_beos.c patch 7.4.2293 Aug 29, 2016
os_beos.h patch 7.4.2293 Aug 29, 2016
os_beos.rsrc updated for version 7.0001 Jun 13, 2004
os_dos.h patch 8.0.1554: custom plugins loaded with --clean Mar 1, 2018
os_mac.h patch 8.1.0810: too many #ifdefs Jan 24, 2019
os_mac.rsr.hqx updated for version 7.0001 Jun 13, 2004
os_mac_conv.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
os_macosx.m Merge remote-tracking branch 'vim/master' Jun 17, 2019
os_mint.h patch 7.4.2293 Aug 29, 2016
os_mswin.c patch 8.1.2064: MS-Windows: compiler warnings for unused arguments Sep 21, 2019
os_qnx.c patch 8.1.1531: clipboard type name is inconsistent Jun 14, 2019
os_qnx.h patch 7.4.2293 Aug 29, 2016
os_unix.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
os_unix.h patch 8.1.1985: code for dealing with paths is spread out Sep 4, 2019
os_unixx.h patch 8.0.0346: Vim relies on limits.h to be included indirectly Feb 21, 2017
os_vms.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
os_vms_conf.h patch 8.1.1630: various small problems Jul 4, 2019
os_vms_fix.com patch 8.1.0528: various typos in comments Nov 16, 2018
os_vms_mms.c updated for version 7.0073 May 19, 2005
os_w32dll.c patch 8.1.1230: a lot of code is shared between vim.exe and gvim.exe Apr 28, 2019
os_w32exe.c patch 8.1.1306: Borland support is outdated and doesn't work May 9, 2019
os_win32.c patch 8.1.2085: MS-Windows: draw error moving cursor over double-cell… Sep 27, 2019
os_win32.h patch 8.1.1306: Borland support is outdated and doesn't work May 9, 2019
osdef.sh patch 7.4.1159 Jan 23, 2016
osdef1.h.in patch 8.1.0319: bzero() function prototype doesn't work for Android Aug 22, 2018
osdef2.h.in patch 8.0.1506: new version of HP NonStop (Tandem) doesn't like a header Feb 12, 2018
pathdef.sh updated for version 7.0001 Jun 13, 2004
popupmenu.c patch 8.1.2082: some files have a weird name to fit in 8.3 characters Sep 27, 2019
popupwin.c patch 8.1.2078: build error with +textprop but without +terminal Sep 25, 2019
profiler.c patch 8.1.2055: not easy to jump to function line from profile Sep 18, 2019
proto.h
protodef.h patch 8.1.0380: "make proto" doesn't work well Sep 13, 2018
pty.c patch 8.1.2021: some global functions can be local to the file Sep 10, 2019
quickfix.c patch 8.1.1971: manually enabling features causes build errors Sep 3, 2019
regexp.c patch 8.1.2005: the regexp.c file is too big Sep 7, 2019
regexp.h patch 8.1.1194: typos and small problems in source files Apr 20, 2019
regexp_bt.c patch 8.1.2010: new file uses old style comments Sep 8, 2019
regexp_nfa.c patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts May 28, 2019
register.c patch 8.1.2077: the ops.c file is too big Sep 25, 2019
screen.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
scriptfile.c patch 8.1.2035: recognizing octal numbers is confusing Sep 15, 2019
search.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
session.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
sha256.c patch 8.1.0443: unnecessary static function prototypes Sep 30, 2018
sign.c patch 8.1.1899: sign_place() does not work as documented Aug 21, 2019
sound.c patch 8.1.1999: calling both PlaySoundW() and PlaySoundA() Sep 7, 2019
spell.c patch 8.1.2081: the spell.c file is too big Sep 27, 2019
spell.h patch 8.1.2081: the spell.c file is too big Sep 27, 2019
spellfile.c patch 8.1.1838: there is :spellwrong and :spellgood but not :spellrare Aug 11, 2019
spellsuggest.c
structs.h Merge remote-tracking branch 'vim/master' Sep 30, 2019
syntax.c patch 8.1.1950: using NULL pointer after an out-of-memory Aug 31, 2019
tag.c patch 8.1.1901: the +insert_expand feature is not always available Aug 21, 2019
tearoff.bmp updated for version 7.0001 Jun 13, 2004
term.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
term.h patch 8.1.0253: saving and restoring window title does not always work Aug 7, 2018
terminal.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
termlib.c patch 8.0.1236: Mac features are confusing Oct 28, 2017
testing.c patch 8.1.1687: the evalfunc.c file is too big Jul 14, 2019
textprop.c patch 8.1.1929: no tests for text property popup window Aug 25, 2019
toolbar.phi updated for version 7.0001 Jun 13, 2004
toolcheck updated for version 7.0001 Jun 13, 2004
tools.bmp Update runtime files. Oct 2, 2018
typemap updated for version 7.3.439 Feb 11, 2012
ui.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
undo.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
uninstall.c patch 8.1.2082: some files have a weird name to fit in 8.3 characters Sep 27, 2019
usercmd.c patch 8.1.1887: the +cmdline_compl feature is not in the tiny version Aug 18, 2019
userfunc.c patch 8.1.2047: cannot check the current state Sep 16, 2019
version.c Merge remote-tracking branch 'vim/master' Sep 30, 2019
version.h patch 8.1.0103: long version string cannot be translated Jun 23, 2018
vim.def Vim 8.1 release May 17, 2018
vim.h
vim.ico updated for version 7.0001 Jun 13, 2004
vim.rc patch 8.1.1306: Borland support is outdated and doesn't work May 9, 2019
vim.tlb updated for version 7.0001 Jun 13, 2004
vim_alert.ico updated for version 7.0001 Jun 13, 2004
vim_error.ico updated for version 7.0001 Jun 13, 2004
vim_icon.xbm updated for version 7.0001 Jun 13, 2004
vim_info.ico updated for version 7.0001 Jun 13, 2004
vim_mask.xbm updated for version 7.0001 Jun 13, 2004
vim_quest.ico updated for version 7.0001 Jun 13, 2004
viminfo.c patch 8.1.1957: more code can be moved to evalvars.c Sep 1, 2019
vimio.h patch 7.4.2293 Aug 29, 2016
vimrun.c patch 8.1.1306: Borland support is outdated and doesn't work May 9, 2019
vimtutor patch 8.0.1703: in the tutor 'showcmd' is not set Apr 12, 2018
which.sh updated for version 7.0001 Jun 13, 2004
winclip.c patch 8.1.1531: clipboard type name is inconsistent Jun 14, 2019
window.c Merge remote-tracking branch 'vim/master' Sep 23, 2019
xpm_w32.c patch 7.4.2293 Aug 29, 2016
xpm_w32.h patch 7.4.1200 Jan 29, 2016

README.md

Vim Logo

Vim source code

Here are a few hints for finding your way around the source code. This doesn't make it less complex than it is, but it gets you started.

You might also want to read :help development.

Jumping around

First of all, use :make tags to generate a tags file, so that you can jump around in the source code.

To jump to a function or variable definition, move the cursor on the name and use the CTRL-] command. Use CTRL-T or CTRL-O to jump back.

To jump to a file, move the cursor on its name and use the gf command.

Most code can be found in a file with an obvious name (incomplete list):

File name Description
arglist.c handling argument list
autocmd.c autocommands
blob.c blob data type
buffer.c manipulating buffers (loaded files)
bufwrite.c writing a buffer to file
change.c handling changes to text
cmdexpand.c command-line completion
cmdhist.c command-line history
debugger.c vim script debugger
diff.c diff mode (vimdiff)
drawline.c drawing a window line
drawscreen.c drawing the windows
eval.c expression evaluation
evalbuffer.c buffer related built-in functions
evalfunc.c built-in functions
evalvars.c vim variables
evalwindow.c window related built-in functions
fileio.c reading and writing files
filepath.c dealing with file names and paths
findfile.c search for files in 'path'
fold.c folding
getchar.c getting characters and key mapping
highlight.c syntax highlighting
indent.c C and Lisp indentation
insexpand.c Insert mode completion
mark.c marks
map.c mapping and abbreviations
mbyte.c multi-byte character handling
memfile.c storing lines for buffers in a swapfile
memline.c storing lines for buffers in memory
menu.c menus
message.c (error) messages
mouse.c handling the mouse
ops.c handling operators ("d", "y", "p")
option.c options
optionstr.c handling string options
popupmenu.c popup menu
popupwin.c popup window
profiler.c vim script profiler
quickfix.c quickfix commands (":make", ":cn")
regexp.c pattern matching
register.c handling registers
scriptfile.c runtime directory handling and sourcing scripts
screen.c lower level screen functions
search.c pattern searching
session.c sessions and views
sign.c signs
spell.c spell checking core
spellfile.c spell file handling
spellsuggest.c spell correction suggestions
syntax.c syntax and other highlighting
tag.c tags
term.c terminal handling, termcap codes
testing.c testing: assert and test functions
textprop.c text properties
undo.c undo and redo
usercmd.c user defined commands
userfunc.c user defined functions
viminfo.c viminfo handling
window.c handling split windows

Debugging

If you have a reasonable recent version of gdb, you can use the :Termdebug command to debug Vim. See :help :Termdebug.

When something is time critical or stepping through code is a hassle, use the channel logging to create a time-stamped log file. Add lines to the code like this:

ch_log(NULL, "Value is now %02x", value);

After compiling and starting Vim, do:

:call ch_logfile('debuglog', 'w')

And edit debuglog to see what happens. The channel functions already have ch_log() calls, thus you always see that in the log.

Important Variables

The current mode is stored in State. The values it can have are NORMAL, INSERT, CMDLINE, and a few others.

The current window is curwin. The current buffer is curbuf. These point to structures with the cursor position in the window, option values, the file name, etc. These are defined in structs.h.

All the global variables are declared in globals.h.

The main loop

This is conveniently called main_loop(). It updates a few things and then calls normal_cmd() to process a command. This returns when the command is finished.

The basic idea is that Vim waits for the user to type a character and processes it until another character is needed. Thus there are several places where Vim waits for a character to be typed. The vgetc() function is used for this. It also handles mapping.

Updating the screen is mostly postponed until a command or a sequence of commands has finished. The work is done by update_screen(), which calls win_update() for every window, which calls win_line() for every line. See the start of screen.c for more explanations.

Command-line mode

When typing a :, normal_cmd() will call getcmdline() to obtain a line with an Ex command. getcmdline() contains a loop that will handle each typed character. It returns when hitting CR or Esc or some other character that ends the command line mode.

Ex commands

Ex commands are handled by the function do_cmdline(). It does the generic parsing of the : command line and calls do_one_cmd() for each separate command. It also takes care of while loops.

do_one_cmd() parses the range and generic arguments and puts them in the exarg_t and passes it to the function that handles the command.

The : commands are listed in ex_cmds.h. The third entry of each item is the name of the function that handles the command. The last entry are the flags that are used for the command.

Normal mode commands

The Normal mode commands are handled by the normal_cmd() function. It also handles the optional count and an extra character for some commands. These are passed in a cmdarg_t to the function that handles the command.

There is a table nv_cmds in normal.c which lists the first character of every command. The second entry of each item is the name of the function that handles the command.

Insert mode commands

When doing an i or a command, normal_cmd() will call the edit() function. It contains a loop that waits for the next character and handles it. It returns when leaving Insert mode.

Options

There is a list with all option names in option.c, called options[].

The GUI

Most of the GUI code is implemented like it was a clever terminal. Typing a character, moving a scrollbar, clicking the mouse, etc. are all translated into events which are written in the input buffer. These are read by the main code, just like reading from a terminal. The code for this is scattered through gui.c. For example, gui_send_mouse_event() for a mouse click and gui_menu_cb() for a menu action. Key hits are handled by the system-specific GUI code, which calls add_to_input_buf() to send the key code.

Updating the GUI window is done by writing codes in the output buffer, just like writing to a terminal. When the buffer gets full or is flushed, gui_write() will parse the codes and draw the appropriate items. Finally the system-specific GUI code will be called to do the work.

Debugging the GUI

Remember to prevent that gvim forks and the debugger thinks Vim has exited, add the -f argument. In gdb: run -f -g.

When stepping through display updating code, the focus event is triggered when going from the debugger to Vim and back. To avoid this, recompile with some code in gui_focus_change() disabled.

Contributing

If you would like to help making Vim better, see the CONTRIBUTING.md file.

This is README.md for version 8.1 of the Vim source code.

You can’t perform that action at this time.