• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

GvimExt/H03-May-2022-1,5611,089

VisVim/H03-May-2022-2,7531,981

auto/H03-May-2022-16,38813,935

if_perl_msvc/H05-Dec-2021-41

libvterm/H05-Dec-2021-12,63610,099

os_mac_rsrc/H03-May-2022-

po/H07-May-2022-257,120185,997

proto/H05-Dec-2021-4,9964,837

tee/H05-Dec-2021-208147

testdir/H07-May-2022-172,519151,307

xdiff/H03-May-2022-4,1882,684

xpm/H03-May-2022-674427

xxd/H05-Dec-2021-1,014785

INSTALLH A D05-Dec-20217.9 KiB230168

Make_all.makH A D05-Dec-2021251 1715

Make_ami.makH A D05-Dec-20212.8 KiB205192

Make_cyg.makH A D05-Dec-20211.4 KiB5440

Make_cyg_ming.makH A D05-Dec-202133.9 KiB1,3271,143

Make_ming.makH A D05-Dec-20211.4 KiB5240

Make_mvc.makH A D05-Dec-202155.9 KiB2,0581,742

Make_vms.mmsH A D05-Dec-202145.6 KiB1,2331,170

MakefileH A D05-Dec-2021169.9 KiB4,3932,578

README.mdH A D05-Dec-20218.1 KiB236176

alloc.cH A D05-Dec-202117.9 KiB870601

alloc.hH A D05-Dec-2021742 3421

arabic.cH A D05-Dec-20219.5 KiB397287

arglist.cH A D05-Dec-202131.5 KiB1,3851,020

ascii.hH A D05-Dec-20214.6 KiB187133

autocmd.cH A D05-Dec-202166.4 KiB2,6881,890

beval.cH A D05-Dec-20217.7 KiB327239

beval.hH A D05-Dec-20212.4 KiB9679

bigvim.batH A D05-Dec-2021715 64

bigvim64.batH A D05-Dec-2021492 86

blob.cH A D05-Dec-202110.3 KiB549398

blowfish.cH A D05-Dec-202123.5 KiB686569

buffer.cH A D05-Dec-2021142.2 KiB5,8424,414

bufwrite.cH A D05-Dec-202167.9 KiB2,6232,028

change.cH A D05-Dec-202161.5 KiB2,3711,678

channel.cH A D05-Dec-2021120.1 KiB5,1083,918

charset.cH A D05-Dec-202150.2 KiB2,1731,574

cindent.cH A D05-Dec-2021102.4 KiB4,1482,843

clientserver.cH A D05-Dec-202124.1 KiB1,046802

clipboard.cH A D05-Dec-202153.7 KiB2,2261,678

cmdexpand.cH A D05-Dec-202172.9 KiB2,9772,362

cmdhist.cH A D05-Dec-202116.9 KiB780603

config.h.inH A D05-Dec-202111.9 KiB510388

config.mk.distH A D05-Dec-202195 65

config.mk.inH A D05-Dec-20214.3 KiB179144

configureH A D05-Dec-2021318 115

configure.acH A D05-Dec-2021150.4 KiB4,6274,254

create_cmdidxs.vimH A D05-Dec-20213.2 KiB10591

crypt.cH A D05-Dec-202123.5 KiB992711

crypt_zip.cH A D05-Dec-20213.3 KiB15795

debugger.cH A D05-Dec-202123.5 KiB1,043833

dehqx.pyH A D05-Dec-20211 KiB4628

dict.cH A D05-Dec-202128.4 KiB1,374987

diff.cH A D05-Dec-202181.7 KiB3,3702,526

digraph.cH A D05-Dec-202159.3 KiB2,7372,471

dimm.idlH A D05-Dec-202126 KiB545487

dlldata.cH A D05-Dec-2021787 3913

dosinst.cH A D05-Dec-202173.1 KiB2,8112,139

dosinst.hH A D05-Dec-202111.9 KiB511343

drawline.cH A D05-Dec-202182.5 KiB3,2952,703

drawscreen.cH A D05-Dec-202183.6 KiB3,2792,423

edit.cH A D05-Dec-2021129 KiB5,4343,978

errors.hH A D05-Dec-202132.3 KiB699678

eval.cH A D05-Dec-2021143.5 KiB6,4524,817

evalbuffer.cH A D05-Dec-202120.9 KiB963713

evalfunc.cH A D05-Dec-2021243.2 KiB10,0828,406

evalvars.cH A D05-Dec-2021105.4 KiB4,5253,410

evalwindow.cH A D05-Dec-202127.9 KiB1,321990

ex_cmdidxs.hH A D05-Dec-20214 KiB7359

ex_cmds.cH A D05-Dec-2021135.4 KiB5,4433,940

ex_cmds.hH A D05-Dec-202167.2 KiB1,9471,880

ex_cmds2.cH A D05-Dec-202122 KiB999733

ex_docmd.cH A D05-Dec-2021221.2 KiB9,5517,231

ex_eval.cH A D05-Dec-202172.7 KiB2,5551,545

ex_getln.cH A D05-Dec-2021108.2 KiB4,6643,506

feature.hH A D03-May-202230.7 KiB1,273508

fileio.cH A D05-Dec-2021138 KiB5,6694,183

filepath.cH A D05-Dec-202196.7 KiB4,2113,119

findfile.cH A D05-Dec-202172.7 KiB2,8771,956

float.cH A D05-Dec-202111.5 KiB592402

fold.cH A D05-Dec-202193.7 KiB3,8262,603

getchar.cH A D05-Dec-202192.1 KiB3,7632,528

glbl_ime.cppH A D05-Dec-20215.6 KiB257150

glbl_ime.hH A D05-Dec-2021921 3423

globals.hH A D05-Dec-202171.9 KiB1,9191,106

gui.cH A D05-Dec-2021139.8 KiB5,6734,110

gui.hH A D05-Dec-202119.4 KiB577415

gui_at_fs.cH A D05-Dec-202157.4 KiB2,7542,309

gui_at_sb.cH A D05-Dec-202132.2 KiB1,193924

gui_at_sb.hH A D05-Dec-20215.7 KiB16275

gui_athena.cH A D05-Dec-202154.5 KiB2,2921,796

gui_beval.cH A D05-Dec-202131.2 KiB1,239949

gui_dwrite.cppH A D05-Dec-202129.5 KiB1,3501,132

gui_dwrite.hH A D05-Dec-20212.4 KiB9349

gui_gtk.cH A D05-Dec-202173.7 KiB2,6942,053

gui_gtk_f.cH A D05-Dec-202122 KiB884671

gui_gtk_f.hH A D05-Dec-20212.1 KiB8151

gui_gtk_res.xmlH A D05-Dec-2021766 1918

gui_gtk_vms.hH A D05-Dec-202130.9 KiB731638

gui_gtk_x11.cH A D05-Dec-2021187.3 KiB7,1095,024

gui_haiku.ccH A D05-Dec-2021119.7 KiB5,0953,605

gui_haiku.hH A D05-Dec-20211.1 KiB5220

gui_motif.cH A D05-Dec-202197.5 KiB4,0333,144

gui_photon.cH A D05-Dec-202167.7 KiB2,9892,222

gui_w32.cH A D05-Dec-2021206.6 KiB8,8046,465

gui_w32_rc.hH A D05-Dec-2021193 91

gui_x11.cH A D05-Dec-202179.8 KiB3,3562,520

gui_x11_pm.hH A D05-Dec-20212.3 KiB9373

gui_xim.cH A D05-Dec-202145.5 KiB1,7991,328

gui_xmdlg.cH A D05-Dec-202131.1 KiB1,280986

gui_xmebw.cH A D05-Dec-202138.9 KiB1,4611,117

gui_xmebw.hH A D05-Dec-20211.7 KiB7334

gui_xmebwp.hH A D05-Dec-20212 KiB8942

gvimtutorH A D05-Dec-2021144 91

hardcopy.cH A D05-Dec-202189 KiB3,4752,576

hashtab.cH A D05-Dec-202112.5 KiB483278

help.cH A D05-Dec-202132.5 KiB1,3251,008

highlight.cH A D05-Dec-2021118 KiB4,5563,601

if_cscope.cH A D05-Dec-202155.7 KiB2,4871,827

if_cscope.hH A D05-Dec-20211.8 KiB7246

if_lua.cH A D05-Dec-202170.5 KiB2,7852,459

if_mzsch.cH A D05-Dec-2021101.1 KiB3,8832,983

if_mzsch.hH A D05-Dec-20212 KiB7754

if_ole.cppH A D05-Dec-202118.1 KiB804521

if_ole.hH A D05-Dec-20217.3 KiB291176

if_ole.idlH A D05-Dec-2021985 4642

if_perl.xsH A D05-Dec-202149.9 KiB1,9821,624

if_perlsfio.cH A D05-Dec-20211.3 KiB6738

if_py_both.hH A D05-Dec-2021149.2 KiB6,9915,678

if_python.cH A D05-Dec-202148.6 KiB1,5561,225

if_python3.cH A D05-Dec-202157.6 KiB1,8691,471

if_ruby.cH A D05-Dec-202148.8 KiB1,9901,694

if_tcl.cH A D05-Dec-202148.2 KiB2,1101,661

if_xcmdsrv.cH A D05-Dec-202137.6 KiB1,5251,008

iid_ole.cH A D05-Dec-20211.2 KiB5829

indent.cH A D05-Dec-202149.7 KiB2,1621,615

infplist.xmlH A D05-Dec-20211.8 KiB7568

insexpand.cH A D05-Dec-2021117.8 KiB4,4933,330

install-shH A D05-Dec-202114.3 KiB502327

installman.shH A D05-Dec-20213.7 KiB12588

installml.shH A D03-May-20223.9 KiB151102

iscygpty.cH A D05-Dec-20214.7 KiB184124

iscygpty.hH A D05-Dec-20211.5 KiB4210

job.cH A D05-Dec-202145.4 KiB2,0181,610

json.cH A D05-Dec-202126.2 KiB1,2071,006

json_test.cH A D05-Dec-20216.4 KiB204151

keymap.hH A D05-Dec-202116.7 KiB516315

kword_test.cH A D05-Dec-20211.7 KiB8356

link.390H A D05-Dec-2021154 87

link.shH A D05-Dec-20214.5 KiB152100

list.cH A D05-Dec-202169.7 KiB3,2982,593

locale.cH A D05-Dec-202112.7 KiB563411

macros.hH A D05-Dec-202112.7 KiB404252

main.cH A D05-Dec-202193.6 KiB3,6652,636

map.cH A D05-Dec-202163.1 KiB2,8182,204

mark.cH A D05-Dec-202135.6 KiB1,5271,136

match.cH A D05-Dec-202132.8 KiB1,4261,154

mbyte.cH A D05-Dec-2021130.8 KiB5,6714,429

memfile.cH A D05-Dec-202136.8 KiB1,501931

memfile_test.cH A D05-Dec-20213 KiB14491

memline.cH A D05-Dec-2021155.9 KiB5,9474,190

menu.cH A D05-Dec-202167.8 KiB3,0172,345

message.cH A D05-Dec-202192.1 KiB4,1333,004

message_test.cH A D05-Dec-20219.6 KiB330225

misc1.cH A D05-Dec-202160.2 KiB2,7361,957

misc2.cH A D05-Dec-202169.6 KiB2,9842,204

mouse.cH A D05-Dec-202178.7 KiB3,1242,379

move.cH A D05-Dec-202169.1 KiB2,9362,271

msvc2008.batH A D05-Dec-2021198 86

msvc2010.batH A D05-Dec-2021200 86

msvc2015.batH A D05-Dec-20211.1 KiB3834

msvcsetup.batH A D05-Dec-2021471 139

msys32.batH A D05-Dec-2021207 75

msys64.batH A D05-Dec-2021207 75

nbdebug.cH A D05-Dec-20213.8 KiB15899

nbdebug.hH A D05-Dec-20211.4 KiB7342

netbeans.cH A D05-Dec-202182.2 KiB3,4912,573

normal.cH A D05-Dec-2021180.8 KiB7,6525,704

ops.cH A D05-Dec-2021108.9 KiB4,2343,249

option.cH A D05-Dec-2021177.6 KiB7,2195,577

option.hH A D05-Dec-202139.9 KiB1,3301,225

optiondefs.hH A D05-Dec-202195 KiB3,0412,959

optionstr.cH A D05-Dec-202161.8 KiB2,6242,106

os_amiga.cH A D05-Dec-202137.3 KiB1,7291,215

os_amiga.hH A D05-Dec-20214.9 KiB238177

os_dos.hH A D05-Dec-20213.1 KiB136105

os_haiku.hH A D05-Dec-20211.3 KiB3821

os_haiku.rdef.inH A D05-Dec-20217.8 KiB143134

os_mac.hH A D05-Dec-20216.3 KiB269181

os_mac.rsr.hqxH A D05-Dec-202141.6 KiB660657

os_mac_conv.cH A D05-Dec-202113.7 KiB596431

os_macosx.mH A D05-Dec-20215.6 KiB216177

os_mswin.cH A D05-Dec-202167.9 KiB3,0322,174

os_qnx.cH A D05-Dec-20213.3 KiB156106

os_qnx.hH A D05-Dec-2021395 208

os_unix.cH A D05-Dec-2021191.4 KiB8,2706,078

os_unix.hH A D05-Dec-202111.6 KiB501385

os_unixx.hH A D05-Dec-20212.5 KiB11776

os_vms.cH A D05-Dec-202118.9 KiB817595

os_vms_conf.hH A D05-Dec-20215 KiB221128

os_vms_fix.comH A D05-Dec-20217.6 KiB277276

os_vms_mms.cH A D05-Dec-20211.3 KiB7876

os_w32dll.cH A D05-Dec-2021712 2811

os_w32exe.cH A D05-Dec-20211 KiB5232

os_win32.cH A D05-Dec-2021192.8 KiB8,3626,151

os_win32.hH A D05-Dec-20215.1 KiB208138

osdef.shH A D05-Dec-20212.9 KiB10167

osdef1.h.inH A D05-Dec-20213.7 KiB139129

osdef2.h.inH A D05-Dec-20212.5 KiB10189

pathdef.shH A D05-Dec-2021251 125

popupmenu.cH A D05-Dec-202138.2 KiB1,6111,237

popupwin.cH A D05-Dec-2021105.7 KiB4,3933,327

profiler.cH A D05-Dec-202122.4 KiB1,019754

proto.hH A D05-Dec-20218.3 KiB339275

protodef.hH A D05-Dec-2021450 198

pty.cH A D05-Dec-202110.5 KiB476343

quickfix.cH A D05-Dec-2021201.8 KiB8,4735,991

regexp.cH A D05-Dec-202169.5 KiB2,9612,176

regexp.hH A D05-Dec-20214.6 KiB17794

regexp_bt.cH A D05-Dec-2021140 KiB5,5744,465

regexp_nfa.cH A D05-Dec-2021187.3 KiB7,6666,115

register.cH A D05-Dec-202170.9 KiB3,0292,348

screen.cH A D05-Dec-2021121.4 KiB5,0113,768

scriptfile.cH A D05-Dec-202150.3 KiB2,1031,552

search.cH A D05-Dec-2021120 KiB4,9123,711

session.cH A D05-Dec-202135.8 KiB1,4131,074

sha256.cH A D05-Dec-202111.9 KiB428332

sign.cH A D05-Dec-202163.1 KiB2,8882,163

sound.cH A D05-Dec-20219.9 KiB465341

spell.cH A D05-Dec-2021103.1 KiB4,4293,170

spell.hH A D05-Dec-202111.6 KiB323193

spellfile.cH A D05-Dec-2021171.4 KiB6,6834,731

spellsuggest.cH A D05-Dec-2021118.9 KiB4,4813,263

strings.cH A D05-Dec-202160.8 KiB2,7992,090

structs.hH A D05-Dec-2021142.4 KiB4,4903,104

syntax.cH A D05-Dec-2021173.3 KiB6,8085,001

tag.cH A D05-Dec-2021104.4 KiB4,3733,283

term.cH A D05-Dec-2021172.7 KiB6,7954,996

termdefs.hH A D05-Dec-20219.5 KiB226188

terminal.cH A D05-Dec-2021177.7 KiB7,4165,691

termlib.cH A D05-Dec-202113.2 KiB619423

testing.cH A D05-Dec-202131.7 KiB1,4021,161

textformat.cH A D05-Dec-202131.2 KiB1,174841

textobject.cH A D05-Dec-202145.6 KiB1,9941,451

textprop.cH A D05-Dec-202144.6 KiB1,9171,458

time.cH A D05-Dec-202125.2 KiB1,116837

toolbar.phiH A D05-Dec-202133.2 KiB1,2841,220

toolcheckH A D05-Dec-2021855 3729

typemapH A D05-Dec-2021284 1513

typval.cH A D05-Dec-202148.9 KiB2,1981,734

ui.cH A D05-Dec-202128.6 KiB1,215809

undo.cH A D05-Dec-202191.3 KiB3,7312,716

uninstall.cH A D05-Dec-202110.6 KiB426330

usercmd.cH A D05-Dec-202138.1 KiB1,7861,414

userfunc.cH A D05-Dec-2021139.8 KiB5,7974,359

version.cH A D05-Dec-202179.7 KiB8,9375,039

version.hH A D05-Dec-20211.9 KiB5123

vim.defH A D05-Dec-202181 54

vim.hH A D05-Dec-202191.1 KiB2,8022,003

vim.manifestH A D05-Dec-20212.2 KiB5945

vim.rcH A D05-Dec-20213.2 KiB137122

vim9.hH A D05-Dec-202117.1 KiB533381

vim9compile.cH A D05-Dec-2021254.5 KiB10,7538,039

vim9execute.cH A D05-Dec-2021151.8 KiB6,0614,882

vim9script.cH A D05-Dec-202124.7 KiB1,051777

vim9type.cH A D05-Dec-202130.4 KiB1,2901,031

vim_icon.xbmH A D05-Dec-2021896 1514

vim_mask.xbmH A D05-Dec-2021911 1514

viminfo.cH A D05-Dec-202180.1 KiB3,3572,635

vimrun.cH A D05-Dec-20212.3 KiB11472

vimtutorH A D05-Dec-20212.1 KiB7540

which.shH A D05-Dec-2021254 137

winclip.cH A D05-Dec-202118.6 KiB777518

window.cH A D05-Dec-2021163.1 KiB7,0215,138

xpm_w32.cH A D05-Dec-20211.1 KiB5733

xpm_w32.hH A D05-Dec-2021131 83

README.md

1![Vim Logo](https://github.com/vim/vim/blob/master/runtime/vimlogo.gif)
2
3# Vim source code #
4
5Here are a few hints for finding your way around the source code.  This
6doesn't make it less complex than it is, but it gets you started.
7
8You might also want to read
9[`:help development`](http://vimdoc.sourceforge.net/htmldoc/develop.html#development).
10
11
12## Jumping around ##
13
14First of all, use `:make tags` to generate a tags file, so that you can jump
15around in the source code.
16
17To jump to a function or variable definition, move the cursor on the name and
18use the `CTRL-]` command.  Use `CTRL-T` or `CTRL-O` to jump back.
19
20To jump to a file, move the cursor on its name and use the `gf` command.
21
22Most code can be found in a file with an obvious name (incomplete list):
23
24File name       | Description
25--------------- | -----------
26alloc.c		| memory management
27arglist.c	| handling argument list
28autocmd.c	| autocommands
29blob.c		| blob data type
30buffer.c	| manipulating buffers (loaded files)
31bufwrite.c	| writing a buffer to file
32change.c	| handling changes to text
33cindent.c	| C and Lisp indentation
34clientserver.c	| client server functionality
35clipboard.c	| handling the clipboard
36cmdexpand.c	| command-line completion
37cmdhist.c	| command-line history
38debugger.c	| vim script debugger
39diff.c		| diff mode (vimdiff)
40drawline.c	| drawing a window line
41drawscreen.c	| drawing the windows
42eval.c		| expression evaluation
43evalbuffer.c	| buffer related built-in functions
44evalfunc.c	| built-in functions
45evalvars.c	| vim variables
46evalwindow.c	| window related built-in functions
47fileio.c	| reading and writing files
48filepath.c	| dealing with file names and paths
49findfile.c	| search for files in 'path'
50fold.c		| folding
51getchar.c	| getting characters and key mapping
52help.c		| vim help related functions
53highlight.c	| syntax highlighting
54indent.c	| text indentation
55insexpand.c	| Insert mode completion
56locale.c	| locale/language handling
57map.c		| mapping and abbreviations
58mark.c		| marks
59match.c		| highlight matching
60float.c		| floating point functions
61mbyte.c		| multi-byte character handling
62memfile.c	| storing lines for buffers in a swapfile
63memline.c	| storing lines for buffers in memory
64menu.c		| menus
65message.c	| (error) messages
66mouse.c		| handling the mouse
67ops.c		| handling operators ("d", "y", "p")
68option.c	| options
69optionstr.c	| handling string options
70popupmenu.c	| popup menu
71popupwin.c	| popup window
72profiler.c	| vim script profiler
73quickfix.c	| quickfix commands (":make", ":cn")
74regexp.c	| pattern matching
75register.c	| handling registers
76scriptfile.c	| runtime directory handling and sourcing scripts
77screen.c	| lower level screen functions
78search.c	| pattern searching
79session.c	| sessions and views
80sign.c		| signs
81spell.c		| spell checking core
82spellfile.c	| spell file handling
83spellsuggest.c	| spell correction suggestions
84strings.c	| string manipulation functions
85syntax.c	| syntax and other highlighting
86tag.c		| tags
87term.c		| terminal handling, termcap codes
88testing.c	| testing: assert and test functions
89textformat.c	| text formatting
90textobject.c	| text objects
91textprop.c	| text properties
92time.c		| time and timer functions
93typval.c	| vim script type/value functions
94undo.c		| undo and redo
95usercmd.c	| user defined commands
96userfunc.c	| user defined functions
97viminfo.c	| viminfo handling
98window.c	| handling split windows
99
100
101## Debugging ##
102
103If you have a reasonable recent version of gdb, you can use the `:Termdebug`
104command to debug Vim.  See  `:help :Termdebug`.
105
106When something is time critical or stepping through code is a hassle, use the
107channel logging to create a time-stamped log file.  Add lines to the code like
108this:
109
110	ch_log(NULL, "Value is now %02x", value);
111
112After compiling and starting Vim, do:
113
114	:call ch_logfile('debuglog', 'w')
115
116And edit `debuglog` to see what happens.  The channel functions already have
117`ch_log()` calls, thus you always see that in the log.
118
119
120## Important Variables ##
121
122The current mode is stored in `State`.  The values it can have are `NORMAL`,
123`INSERT`, `CMDLINE`, and a few others.
124
125The current window is `curwin`.  The current buffer is `curbuf`.  These point
126to structures with the cursor position in the window, option values, the file
127name, etc.  These are defined in
128[`structs.h`](https://github.com/vim/vim/blob/master/src/structs.h).
129
130All the global variables are declared in
131[`globals.h`](https://github.com/vim/vim/blob/master/src/globals.h).
132
133
134## The main loop ##
135
136This is conveniently called `main_loop()`.  It updates a few things and then
137calls `normal_cmd()` to process a command.  This returns when the command is
138finished.
139
140The basic idea is that Vim waits for the user to type a character and
141processes it until another character is needed.  Thus there are several places
142where Vim waits for a character to be typed.  The `vgetc()` function is used
143for this.  It also handles mapping.
144
145Updating the screen is mostly postponed until a command or a sequence of
146commands has finished.  The work is done by `update_screen()`, which calls
147`win_update()` for every window, which calls `win_line()` for every line.
148See the start of
149[`screen.c`](https://github.com/vim/vim/blob/master/src/screen.c)
150for more explanations.
151
152
153## Command-line mode ##
154
155When typing a `:`, `normal_cmd()` will call `getcmdline()` to obtain a line
156with an Ex command.  `getcmdline()` contains a loop that will handle each typed
157character.  It returns when hitting `CR` or `Esc` or some other character that
158ends the command line mode.
159
160
161## Ex commands ##
162
163Ex commands are handled by the function `do_cmdline()`.  It does the generic
164parsing of the `:` command line and calls `do_one_cmd()` for each separate
165command.  It also takes care of while loops.
166
167`do_one_cmd()` parses the range and generic arguments and puts them in the
168`exarg_t` and passes it to the function that handles the command.
169
170The `:` commands are listed in `ex_cmds.h`.  The third entry of each item is
171the name of the function that handles the command.  The last entry are the
172flags that are used for the command.
173
174
175## Normal mode commands ##
176
177The Normal mode commands are handled by the `normal_cmd()` function.  It also
178handles the optional count and an extra character for some commands.  These
179are passed in a `cmdarg_t` to the function that handles the command.
180
181There is a table `nv_cmds` in
182[`normal.c`](https://github.com/vim/vim/blob/master/src/normal.c)
183which lists the first character of every command.  The second entry of each
184item is the name of the function that handles the command.
185
186
187## Insert mode commands ##
188
189When doing an `i` or `a` command, `normal_cmd()` will call the `edit()`
190function. It contains a loop that waits for the next character and handles it.
191It returns when leaving Insert mode.
192
193
194## Options ##
195
196There is a list with all option names in
197[`option.c`](https://github.com/vim/vim/blob/master/src/option.c),
198called `options[]`.
199
200
201## The GUI ##
202
203Most of the GUI code is implemented like it was a clever terminal.  Typing a
204character, moving a scrollbar, clicking the mouse, etc. are all translated
205into events which are written in the input buffer.  These are read by the
206main code, just like reading from a terminal.  The code for this is scattered
207through [`gui.c`](https://github.com/vim/vim/blob/master/src/gui.c).
208For example, `gui_send_mouse_event()` for a mouse click and `gui_menu_cb()` for
209a menu action.  Key hits are handled by the system-specific GUI code, which
210calls `add_to_input_buf()` to send the key code.
211
212Updating the GUI window is done by writing codes in the output buffer, just
213like writing to a terminal.  When the buffer gets full or is flushed,
214`gui_write()` will parse the codes and draw the appropriate items.  Finally the
215system-specific GUI code will be called to do the work.
216
217
218## Debugging the GUI ##
219
220Remember to prevent that gvim forks and the debugger thinks Vim has exited,
221add the `-f` argument.  In gdb: `run -f -g`.
222
223When stepping through display updating code, the focus event is triggered
224when going from the debugger to Vim and back.  To avoid this, recompile with
225some code in `gui_focus_change()` disabled.
226
227
228## Contributing ##
229
230If you would like to help making Vim better, see the
231[`CONTRIBUTING.md`](https://github.com/vim/vim/blob/master/CONTRIBUTING.md)
232file.
233
234
235This is `README.md` for version 8.2 of the Vim source code.
236