• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..30-Apr-201448

arabic.cH A D31-Aug-200920.5 KiB

arabic.hH A D31-Aug-20096.6 KiB

ascii.hH A D31-Aug-20094.8 KiB

auto/H30-Apr-201411

bigvim.batH A D08-Sep-2010383

blowfish.cH A D08-Sep-201023.6 KiB

buffer.cH A D08-Sep-2010132.4 KiB

charset.cH A D08-Sep-201045.2 KiB

config.aap.inH A D08-Sep-20102.8 KiB

config.h.inH A D08-Sep-201010 KiB

config.mk.distH A D31-Aug-2009110

config.mk.inH A D08-Sep-20104 KiB

configureH A D31-Aug-2009318

configure.inH A D08-Sep-2010107.9 KiB

dehqx.pyH A D31-Aug-2009817

diff.cH A D08-Sep-201063.3 KiB

digraph.cH A D08-Sep-201055 KiB

dimm.idlH A D31-Aug-200926 KiB

dlldata.cH A D31-Aug-2009787

dosinst.cH A D08-Sep-201067.5 KiB

dosinst.hH A D08-Sep-201015.2 KiB

edit.cH A D08-Sep-2010239.2 KiB

eval.cH A D08-Sep-2010515.4 KiB

ex_cmds.cH A D08-Sep-2010178.1 KiB

ex_cmds.hH A D08-Sep-201043.1 KiB

ex_cmds2.cH A D08-Sep-201094.4 KiB

ex_docmd.cH A D08-Sep-2010253.7 KiB

ex_eval.cH A D08-Sep-201067.3 KiB

ex_getln.cH A D08-Sep-2010151 KiB

farsi.cH A D08-Sep-201036.9 KiB

farsi.hH A D31-Aug-20095.7 KiB

feature.hH A D08-Sep-201032 KiB

fileio.cH A D13-Mar-2012255.9 KiB

fold.cH A D08-Sep-201083.2 KiB

getchar.cH A D08-Sep-2010121 KiB

glbl_ime.cppH A D31-Aug-20095.7 KiB

glbl_ime.hH A D31-Aug-2009942

globals.hH A D08-Sep-201058.1 KiB

gui.cH A D08-Sep-2010130.9 KiB

gui.hH A D08-Sep-201018.5 KiB

gui_at_fs.cH A D08-Sep-201060.9 KiB

gui_at_sb.cH A D08-Sep-201033.1 KiB

gui_at_sb.hH A D31-Aug-20095.8 KiB

gui_athena.cH A D08-Sep-201056.1 KiB

gui_beval.cH A D08-Sep-201033.1 KiB

gui_beval.hH A D31-Aug-20092.2 KiB

gui_gtk.cH A D08-Sep-201050.9 KiB

gui_gtk_f.cH A D08-Sep-201020.6 KiB

gui_gtk_f.hH A D08-Sep-20101.7 KiB

gui_gtk_vms.hH A D31-Aug-200931.3 KiB

gui_gtk_x11.cH A D08-Sep-2010157.7 KiB

gui_mac.cH A D08-Sep-2010168.3 KiB

gui_motif.cH A D08-Sep-2010100.8 KiB

gui_photon.cH A D08-Sep-201072.7 KiB

gui_riscos.cH A D31-Aug-200983.4 KiB

gui_riscos.hH A D31-Aug-2009764

gui_w16.cH A D08-Sep-201037.5 KiB

gui_w32.cH A D08-Sep-2010119.4 KiB

gui_w32_rc.hH A D31-Aug-2009193

gui_w48.cH A D08-Sep-201088.6 KiB

gui_x11.cH A D08-Sep-201086.2 KiB

gui_x11_pm.hH A D31-Aug-20092.3 KiB

gui_xmdlg.cH A D08-Sep-201031.2 KiB

gui_xmebw.cH A D08-Sep-201038.7 KiB

gui_xmebw.hH A D31-Aug-20091.7 KiB

gui_xmebwp.hH A D31-Aug-20092 KiB

guiw16rc.hH A D31-Aug-2009469

gvim.exe.mnfH A D08-Sep-20101.1 KiB

GvimExt/H30-Apr-201416

gvimtutorH A D31-Aug-2009143

hangulin.cH A D31-Aug-200959.4 KiB

hardcopy.cH A D08-Sep-201094.2 KiB

hashtab.cH A D08-Sep-201012.8 KiB

if_cscope.cH A D08-Sep-201058.1 KiB

if_cscope.hH A D08-Sep-20102.3 KiB

if_lua.cH A D08-Sep-201032.3 KiB

if_mzsch.cH A D08-Sep-201090.7 KiB

if_mzsch.hH A D08-Sep-20102.2 KiB

if_ole.cppH A D08-Sep-201018.1 KiB

if_ole.hH A D31-Aug-20097.2 KiB

if_ole.idlH A D31-Aug-2009985

if_perl.xsH A D08-Sep-201033.1 KiB

if_perlsfio.cH A D31-Aug-20091.4 KiB

if_py_both.hH A D08-Sep-201026.8 KiB

if_python.cH A D05-Dec-201144.9 KiB

if_python3.cH A D08-Sep-201041.8 KiB

if_ruby.cH A D28-Apr-201438 KiB

if_sniff.cH A D08-Sep-201027.9 KiB

if_sniff.hH A D08-Sep-2010383

if_tcl.cH A D08-Sep-201048.3 KiB

if_xcmdsrv.cH A D08-Sep-201037.4 KiB

iid_ole.cH A D31-Aug-20091.2 KiB

infplist.xmlH A D31-Aug-20091.8 KiB

INSTALLH A D08-Sep-201017.3 KiB

INSTALLami.txtH A D31-Aug-20091.1 KiB

INSTALLmac.txtH A D31-Aug-20091.9 KiB

installman.shH A D31-Aug-20093.3 KiB

installml.shH A D31-Aug-20094.5 KiB

INSTALLpc.txtH A D08-Sep-201014.9 KiB

INSTALLvms.txtH A D08-Sep-201012.1 KiB

INSTALLx.txtH A D08-Sep-20105.2 KiB

integration.cH A D08-Sep-201026.2 KiB

integration.hH A D08-Sep-201016 KiB

keymap.hH A D08-Sep-201015.6 KiB

link.390H A D31-Aug-2009154

link.shH A D08-Sep-20104.2 KiB

macros.hH A D08-Sep-20109.2 KiB

main.aapH A D08-Sep-201046 KiB

main.cH A D15-Nov-2010103.7 KiB

Make_bc3.makH A D08-Sep-20102.9 KiB

Make_bc5.makH A D08-Sep-201025.9 KiB

Make_cyg.makH A D08-Sep-201016.3 KiB

Make_dice.makH A D08-Sep-20103.7 KiB

Make_djg.makH A D08-Sep-20102.1 KiB

Make_dvc.makH A D31-Aug-20092.4 KiB

Make_ivc.makH A D08-Sep-201018.3 KiB

Make_manx.makH A D08-Sep-20106.4 KiB

Make_ming.makH A D08-Sep-201017.4 KiB

Make_mint.makH A D31-Aug-20091.7 KiB

Make_morph.makH A D08-Sep-20101.3 KiB

Make_mvc.makH A D08-Sep-201032.2 KiB

Make_os2.makH A D08-Sep-20103.5 KiB

Make_ro.makH A D31-Aug-20091.9 KiB

Make_sas.makH A D08-Sep-20108.4 KiB

Make_vms.mmsH A D08-Sep-201031.1 KiB

Make_w16.makH A D31-Aug-20095.4 KiB

MakefileH A D08-Sep-2010117.3 KiB

mark.cH A D08-Sep-201042.2 KiB

mbyte.cH A D08-Sep-2010144.7 KiB

memfile.cH A D08-Sep-201034.7 KiB

memline.cH A D08-Sep-2010141.1 KiB

menu.cH A D08-Sep-201057.3 KiB

message.cH A D08-Sep-2010109.7 KiB

misc1.cH A D08-Sep-2010237.9 KiB

misc2.cH A D08-Sep-2010148.6 KiB

mkinstalldirsH A D08-Sep-2010638

move.cH A D08-Sep-201067 KiB

msvc2008.batH A D08-Sep-2010199

msvcsetup.batH A D31-Aug-2009471

mysignH A D31-Aug-2009140

nbdebug.cH A D08-Sep-20103.9 KiB

nbdebug.hH A D08-Sep-20101.4 KiB

netbeans.cH A D08-Sep-201092 KiB

normal.cH A D08-Sep-2010221.8 KiB

ops.cH A D15-Nov-2010158.1 KiB

option.cH A D08-Sep-2010289.4 KiB

option.hH A D08-Sep-201033.4 KiB

os_amiga.cH A D31-Aug-200935.5 KiB

os_amiga.hH A D31-Aug-20094.5 KiB

os_beos.cH A D31-Aug-20094.3 KiB

os_beos.hH A D31-Aug-2009508

os_dos.hH A D31-Aug-20092.8 KiB

os_mac.hH A D08-Sep-20107.4 KiB

os_mac.rsr.hqxH A D31-Aug-200941.6 KiB

os_mac_conv.cH A D08-Sep-201013.8 KiB

os_mac_rsrc/H30-Apr-20145

os_macosx.cH A D31-Aug-200916.9 KiB

os_macosx.mH A D08-Sep-20105.1 KiB

os_mint.hH A D31-Aug-2009281

os_msdos.cH A D08-Sep-201075.2 KiB

os_msdos.hH A D31-Aug-20092.5 KiB

os_mswin.cH A D08-Sep-201080.2 KiB

os_os2_cfg.hH A D31-Aug-20096.5 KiB

os_qnx.cH A D31-Aug-20093.5 KiB

os_qnx.hH A D31-Aug-2009393

os_riscos.cH A D08-Sep-201026.9 KiB

os_riscos.hH A D31-Aug-20093.8 KiB

os_unix.cH A D14-Aug-2012162.8 KiB

os_unix.hH A D08-Sep-201012.5 KiB

os_unixx.hH A D08-Sep-20102.8 KiB

os_vms.cH A D08-Sep-201015.4 KiB

os_vms_conf.hH A D08-Sep-20104.5 KiB

os_vms_fix.comH A D31-Aug-20097.6 KiB

os_vms_mms.cH A D31-Aug-20091.3 KiB

os_w32dll.cH A D31-Aug-2009623

os_w32exe.cH A D31-Aug-20092.7 KiB

os_win16.cH A D08-Sep-20107.9 KiB

os_win16.hH A D31-Aug-20093.4 KiB

os_win32.cH A D08-Sep-2010122.9 KiB

os_win32.hH A D08-Sep-20105.1 KiB

osdef.shH A D08-Sep-20103 KiB

osdef1.h.inH A D08-Sep-20104.2 KiB

osdef2.h.inH A D31-Aug-20092.9 KiB

pathdef.shH A D31-Aug-2009251

po/H30-Apr-201447

popupmnu.cH A D08-Sep-201017 KiB

proto/H30-Apr-201485

proto.hH A D08-Sep-20106.8 KiB

pty.cH A D08-Sep-20108.8 KiB

quickfix.cH A D08-Sep-201096.3 KiB

README.txtH A D08-Sep-20105.1 KiB

regexp.cH A D08-Sep-2010172.4 KiB

regexp.hH A D31-Aug-20092.3 KiB

screen.cH A D08-Sep-2010245.9 KiB

search.cH A D08-Sep-2010128.3 KiB

sha256.cH A D08-Sep-201012.2 KiB

spell.cH A D08-Sep-2010412 KiB

structs.hH A D08-Sep-201077.6 KiB

swis.sH A D31-Aug-20092.1 KiB

syntax.cH A D08-Sep-2010245.7 KiB

tag.cH A D08-Sep-201095.5 KiB

tearoff.bmpH A D31-Aug-2009118

tee/H30-Apr-20144

term.cH A D08-Sep-2010147.1 KiB

term.hH A D31-Aug-20096.9 KiB

termlib.cH A D31-Aug-200913.7 KiB

testdir/H30-Apr-2014167

toolbar.phiH A D31-Aug-200933.2 KiB

toolcheckH A D31-Aug-2009855

tools.bmpH A D31-Aug-20095 KiB

tools16.bmpH A D31-Aug-20093.7 KiB

typemapH A D31-Aug-2009276

ui.cH A D08-Sep-201075.2 KiB

undo.cH A D08-Sep-201082.5 KiB

uninstal.cH A D08-Sep-201011.1 KiB

version.cH A D08-Sep-201023.7 KiB

version.hH A D08-Sep-20101.4 KiB

vim.defH A D08-Sep-201081

vim.hH A D08-Sep-201069.8 KiB

vim.icoH A D31-Aug-20091.1 KiB

vim.rcH A D31-Aug-20093.1 KiB

vim.tlbH A D31-Aug-20091.8 KiB

vim16.defH A D08-Sep-201099

vim16.rcH A D31-Aug-20092 KiB

vim_alert.icoH A D31-Aug-20091.1 KiB

vim_error.icoH A D31-Aug-20091.1 KiB

vim_icon.xbmH A D31-Aug-2009896

vim_info.icoH A D31-Aug-20091.1 KiB

vim_mask.xbmH A D31-Aug-2009911

vim_quest.icoH A D31-Aug-20091.1 KiB

vimio.hH A D31-Aug-2009463

vimrun.cH A D31-Aug-20092.1 KiB

vimtbar.hH A D31-Aug-20095 KiB

vimtbar.libH A D31-Aug-20091 KiB

vimtutorH A D31-Aug-20092 KiB

VisVim/H30-Apr-201423

which.shH A D31-Aug-2009254

window.cH A D08-Sep-2010149.9 KiB

workshop.cH A D08-Sep-201040.5 KiB

workshop.hH A D31-Aug-2009575

wsdebug.cH A D31-Aug-20094.4 KiB

wsdebug.hH A D31-Aug-20091.4 KiB

xpm_w32.cH A D31-Aug-20091.1 KiB

xpm_w32.hH A D31-Aug-2009140

xxd/H30-Apr-201412

README.txt

1README for the Vim source code
2
3Here are a few hints for finding your way around the source code.  This
4doesn't make it less complex than it is, but it gets you started.
5
6You might also want to read ":help development".
7
8
9JUMPING AROUND
10
11First of all, use ":make tags" to generate a tags file, so that you can use
12the ":tag" command to jump around the source code.
13
14To jump to a function or variable definition, move the cursor on the name and
15use the CTRL-] command.  Use CTRL-T or CTRL-O to jump back.
16
17To jump to a file, move the cursor on its name and use the "gf" command.
18
19Most code can be found in a file with an obvious name (incomplete list):
20	buffer.c	manipulating buffers (loaded files)
21	diff.c		diff mode (vimdiff)
22	eval.c		expression evaluation
23	fileio.c	reading and writing files
24	fold.c		folding
25	getchar.c	getting characters and key mapping
26	mark.c		marks
27	mbyte.c		multi-byte character handling
28	memfile.c	storing lines for buffers in a swapfile
29	memline.c	storing lines for buffers in memory
30	menu.c		menus
31	message.c	(error) messages
32	ops.c		handling operators ("d", "y", "p")
33	option.c	options
34	quickfix.c	quickfix commands (":make", ":cn")
35	regexp.c	pattern matching
36	screen.c	updating the windows
37	search.c	pattern searching
38	spell.c		spell checking
39	syntax.c	syntax and other highlighting
40	tag.c		tags
41	term.c		terminal handling, termcap codes
42	undo.c		undo and redo
43	window.c	handling split windows
44
45
46IMPORTANT VARIABLES
47
48The current mode is stored in "State".  The values it can have are NORMAL,
49INSERT, CMDLINE, and a few others.
50
51The current window is "curwin".  The current buffer is "curbuf".  These point
52to structures with the cursor position in the window, option values, the file
53name, etc.  These are defined in structs.h.
54
55All the global variables are declared in globals.h.
56
57
58THE MAIN LOOP
59
60This is conveniently called main_loop().  It updates a few things and then
61calls normal_cmd() to process a command.  This returns when the command is
62finished.
63
64The basic idea is that Vim waits for the user to type a character and
65processes it until another character is needed.  Thus there are several places
66where Vim waits for a character to be typed.  The vgetc() function is used for
67this.  It also handles mapping.
68
69Updating the screen is mostly postponed until a command or a sequence of
70commands has finished.  The work is done by update_screen(), which calls
71win_update() for every window, which calls win_line() for every line.
72See the start of screen.c for more explanations.
73
74
75COMMAND-LINE MODE
76
77When typing a ":", normal_cmd() will call getcmdline() to obtain a line with
78an Ex command.  getcmdline() contains a loop that will handle each typed
79character.  It returns when hitting <CR> or <Esc> or some other character that
80ends the command line mode.
81
82
83EX COMMANDS
84
85Ex commands are handled by the function do_cmdline().  It does the generic
86parsing of the ":" command line and calls do_one_cmd() for each separate
87command.  It also takes care of while loops.
88
89do_one_cmd() parses the range and generic arguments and puts them in the
90exarg_t and passes it to the function that handles the command.
91
92The ":" commands are listed in ex_cmds.h.  The third entry of each item is the
93name of the function that handles the command.  The last entry are the flags
94that are used for the command.
95
96
97NORMAL MODE COMMANDS
98
99The Normal mode commands are handled by the normal_cmd() function.  It also
100handles the optional count and an extra character for some commands.  These
101are passed in a cmdarg_t to the function that handles the command.
102
103There is a table nv_cmds in normal.c which lists the first character of every
104command.  The second entry of each item is the name of the function that
105handles the command.
106
107
108INSERT MODE COMMANDS
109
110When doing an "i" or "a" command, normal_cmd() will call the edit() function.
111It contains a loop that waits for the next character and handles it.  It
112returns when leaving Insert mode.
113
114
115OPTIONS
116
117There is a list with all option names in option.c, called options[].
118
119
120THE GUI
121
122Most of the GUI code is implemented like it was a clever terminal.  Typing a
123character, moving a scrollbar, clicking the mouse, etc. are all translated
124into events which are written in the input buffer.  These are read by the
125main code, just like reading from a terminal.  The code for this is scattered
126through gui.c.  For example: gui_send_mouse_event() for a mouse click and
127gui_menu_cb() for a menu action.  Key hits are handled by the system-specific
128GUI code, which calls add_to_input_buf() to send the key code.
129
130Updating the GUI window is done by writing codes in the output buffer, just
131like writing to a terminal.  When the buffer gets full or is flushed,
132gui_write() will parse the codes and draw the appropriate items.  Finally the
133system-specific GUI code will be called to do the work.
134
135
136DEBUGGING THE GUI
137
138Remember to prevent that gvim forks and the debugger thinks Vim has exited,
139add the "-f" argument.  In gdb: "run -f -g".
140
141When stepping through display updating code, the focus event is triggered
142when going from the debugger to Vim and back.  To avoid this, recompile with
143some code in gui_focus_change() disabled.
144