vim/src
2004-09-13 20:26:32 +00:00
..
auto updated for version 7.0010 2004-07-18 21:34:53 +00:00
GvimExt updated for version 7.0015 2004-09-06 17:44:46 +00:00
os_mac.pbproj updated for version 7.0010 2004-07-18 21:34:53 +00:00
po updated for version 7.0016 2004-09-13 20:26:32 +00:00
proto updated for version 7.0016 2004-09-13 20:26:32 +00:00
tee updated for version 7.0001 2004-06-13 20:20:40 +00:00
testdir updated for version 7.0016 2004-09-13 20:26:32 +00:00
VisVim updated for version 7.0001 2004-06-13 20:20:40 +00:00
xxd updated for version 7.0001 2004-06-13 20:20:40 +00:00
arabic.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
arabic.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
ascii.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
bigvim.bat updated for version 7.0001 2004-06-13 20:20:40 +00:00
buffer.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
charset.c updated for version 7.0008 2004-07-12 15:53:54 +00:00
config.aap.in updated for version 7.0008 2004-07-12 15:53:54 +00:00
config.h.in updated for version 7.0006 2004-07-05 15:58:32 +00:00
config.mk.dist updated for version 7.0001 2004-06-13 20:20:40 +00:00
config.mk.in updated for version 7.0010 2004-07-18 21:34:53 +00:00
configure updated for version 7.0001 2004-06-13 20:20:40 +00:00
configure.in updated for version 7.0010 2004-07-18 21:34:53 +00:00
dehqx.py updated for version 7.0001 2004-06-13 20:20:40 +00:00
diff.c updated for version 7.0008 2004-07-12 15:53:54 +00:00
digraph.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
dimm.idl updated for version 7.0001 2004-06-13 20:20:40 +00:00
dlldata.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
dosinst.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
dosinst.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
edit.c updated for version 7.0012 2004-07-26 12:53:41 +00:00
eval.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
ex_cmds.c updated for version 7.0015 2004-09-06 17:44:46 +00:00
ex_cmds.h updated for version 7.0016 2004-09-13 20:26:32 +00:00
ex_cmds2.c updated for version 7.0014 2004-09-02 19:12:26 +00:00
ex_docmd.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
ex_eval.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
ex_getln.c updated for version 7.0013 2004-07-29 08:43:53 +00:00
farsi.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
farsi.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
feature.h updated for version 7.0008 2004-07-12 15:53:54 +00:00
fileio.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
fold.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
getchar.c updated for version 7.0002 2004-06-24 15:53:16 +00:00
glbl_ime.cpp updated for version 7.0001 2004-06-13 20:20:40 +00:00
glbl_ime.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
globals.h updated for version 7.0007 2004-07-10 09:47:34 +00:00
gui.c updated for version 7.0013 2004-07-29 08:43:53 +00:00
gui.h updated for version 7.0003 2004-06-30 16:16:41 +00:00
gui_amiga.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_amiga.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_at_fs.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_at_sb.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_at_sb.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_athena.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_beos.cc updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_beos.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_beval.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_beval.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_gtk.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_gtk_f.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_gtk_f.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_gtk_vms.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_gtk_x11.c updated for version 7.0014 2004-09-02 19:12:26 +00:00
gui_kde.cc updated for version 7.0015 2004-09-06 17:44:46 +00:00
gui_kde_wid.cc updated for version 7.0016 2004-09-13 20:26:32 +00:00
gui_kde_wid.h updated for version 7.0012 2004-07-26 12:53:41 +00:00
gui_kde_x11.cc updated for version 7.0015 2004-09-06 17:44:46 +00:00
gui_mac.c updated for version 7.0011 2004-07-19 20:55:54 +00:00
gui_mac.icns updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_mac.r updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_motif.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_photon.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_riscos.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_riscos.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_w16.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_w32.c updated for version 7.0002 2004-06-20 12:51:53 +00:00
gui_w32_rc.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
gui_w48.c updated for version 7.0015 2004-09-06 17:44:46 +00:00
gui_x11.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
guiw16rc.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
gvim.exe.mnf updated for version 7.0001 2004-06-13 20:20:40 +00:00
hangulin.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
if_cscope.c updated for version 7.0004 2004-07-02 15:38:35 +00:00
if_cscope.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
if_mzsch.c updated for version 7.0008 2004-07-12 15:53:54 +00:00
if_mzsch.h updated for version 7.0006 2004-07-05 15:58:32 +00:00
if_ole.cpp updated for version 7.0001 2004-06-13 20:20:40 +00:00
if_ole.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
if_ole.idl updated for version 7.0001 2004-06-13 20:20:40 +00:00
if_perl.xs updated for version 7.0001 2004-06-13 20:20:40 +00:00
if_perlsfio.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
if_python.c updated for version 7.0012 2004-07-26 12:53:41 +00:00
if_ruby.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
if_sniff.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
if_sniff.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
if_tcl.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
if_xcmdsrv.c updated for version 7.0013 2004-07-29 08:43:53 +00:00
iid_ole.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
infplist.xml updated for version 7.0001 2004-06-13 20:20:40 +00:00
INSTALL updated for version 7.0003 2004-06-30 16:16:41 +00:00
INSTALLami.txt updated for version 7.0001 2004-06-13 20:20:40 +00:00
INSTALLkde.txt updated for version 7.0003 2004-06-30 16:16:41 +00:00
INSTALLmac.txt updated for version 7.0001 2004-06-13 20:20:40 +00:00
INSTALLpc.txt updated for version 7.0001 2004-06-13 20:20:40 +00:00
INSTALLvms.txt updated for version 7.0001 2004-06-13 20:20:40 +00:00
integration.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
integration.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
keymap.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
kvim_iface.h updated for version 7.0003 2004-06-30 16:16:41 +00:00
link.390 updated for version 7.0001 2004-06-13 20:20:40 +00:00
link.sh updated for version 7.0001 2004-06-13 20:20:40 +00:00
macros.h updated for version 7.0013 2004-07-29 08:43:53 +00:00
main.aap updated for version 7.0012 2004-07-26 12:53:41 +00:00
main.c updated for version 7.0015 2004-09-06 17:44:46 +00:00
Make_agui.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_aros.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_bc3.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_bc5.mak updated for version 7.0004 2004-07-02 15:38:35 +00:00
Make_cyg.mak updated for version 7.0004 2004-07-02 15:38:35 +00:00
Make_dice.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_djg.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_dvc.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_ivc.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_manx.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_ming.mak updated for version 7.0016 2004-09-13 20:26:32 +00:00
Make_mint.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_morph.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_mpw.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_mvc.mak updated for version 7.0011 2004-07-19 20:55:54 +00:00
Make_os2.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_ro.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_sas.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_vms.mms updated for version 7.0001 2004-06-13 20:20:40 +00:00
Make_w16.mak updated for version 7.0001 2004-06-13 20:20:40 +00:00
Makefile updated for version 7.0012 2004-07-26 12:53:41 +00:00
mark.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
mbyte.c updated for version 7.0015 2004-09-06 17:44:46 +00:00
memfile.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
memline.c updated for version 7.0012 2004-07-26 12:53:41 +00:00
menu.c updated for version 7.0003 2004-06-30 16:16:41 +00:00
message.c updated for version 7.0008 2004-07-12 15:53:54 +00:00
misc1.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
misc2.c updated for version 7.0012 2004-07-26 12:53:41 +00:00
mkinstalldirs updated for version 7.0001 2004-06-13 20:20:40 +00:00
move.c updated for version 7.0005 2004-07-03 16:05:59 +00:00
mysign updated for version 7.0010 2004-07-18 21:34:53 +00:00
nbdebug.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
nbdebug.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
netbeans.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
normal.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
ops.c updated for version 7.0014 2004-09-02 19:12:26 +00:00
option.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
option.h updated for version 7.0007 2004-07-10 09:47:34 +00:00
os_amiga.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_amiga.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_beos.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_beos.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_beos.rsrc updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_dos.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_mac.build updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_mac.c updated for version 7.0007 2004-07-10 09:47:34 +00:00
os_mac.h updated for version 7.0012 2004-07-26 12:53:41 +00:00
os_mac.rsr.hqx updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_mac.sit.hqx updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_mac_conv.c updated for version 7.0012 2004-07-26 12:53:41 +00:00
os_macosx.c updated for version 7.0010 2004-07-18 21:34:53 +00:00
os_mint.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_msdos.c updated for version 7.0002 2004-06-20 12:51:53 +00:00
os_msdos.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_mswin.c updated for version 7.0015 2004-09-06 17:44:46 +00:00
os_os2_cfg.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_qnx.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_qnx.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_riscos.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
os_riscos.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_unix.c updated for version 7.0014 2004-09-02 19:12:26 +00:00
os_unix.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_unixx.h updated for version 7.0003 2004-06-30 16:16:41 +00:00
os_vms.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_vms_conf.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_vms_fix.com updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_vms_mms.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_w32dll.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_w32exe.c updated for version 7.0015 2004-09-06 17:44:46 +00:00
os_win16.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_win16.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
os_win32.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
os_win32.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
osdef.sh updated for version 7.0001 2004-06-13 20:20:40 +00:00
osdef1.h.in updated for version 7.0001 2004-06-13 20:20:40 +00:00
osdef2.h.in updated for version 7.0001 2004-06-13 20:20:40 +00:00
pathdef.sh updated for version 7.0001 2004-06-13 20:20:40 +00:00
proto.h updated for version 7.0006 2004-07-05 15:58:32 +00:00
pty.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
quickfix.c updated for version 7.0009 2004-07-16 20:18:37 +00:00
README.txt updated for version 7.0001 2004-06-13 20:20:40 +00:00
regexp.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
regexp.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
screen.c updated for version 7.0005 2004-07-03 16:05:59 +00:00
search.c updated for version 7.0012 2004-07-26 12:53:41 +00:00
structs.h updated for version 7.0016 2004-09-13 20:26:32 +00:00
swis.s updated for version 7.0001 2004-06-13 20:20:40 +00:00
syntax.c updated for version 7.0016 2004-09-13 20:26:32 +00:00
tag.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
tearoff.bmp updated for version 7.0001 2004-06-13 20:20:40 +00:00
term.c updated for version 7.0014 2004-09-02 19:12:26 +00:00
term.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
termlib.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
toolbar.phi updated for version 7.0001 2004-06-13 20:20:40 +00:00
toolcheck updated for version 7.0001 2004-06-13 20:20:40 +00:00
tools.bmp updated for version 7.0001 2004-06-13 20:20:40 +00:00
tools16.bmp updated for version 7.0001 2004-06-13 20:20:40 +00:00
typemap updated for version 7.0001 2004-06-13 20:20:40 +00:00
ui.c updated for version 7.0003 2004-06-30 16:16:41 +00:00
undo.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
uninstal.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
version.c updated for version 7.0006 2004-07-05 15:58:32 +00:00
version.h updated for version 7.0003 2004-06-30 16:16:41 +00:00
vim.def updated for version 7.0001 2004-06-13 20:20:40 +00:00
vim.h updated for version 7.0016 2004-09-13 20:26:32 +00:00
vim.ico updated for version 7.0001 2004-06-13 20:20:40 +00:00
vim.rc updated for version 7.0001 2004-06-13 20:20:40 +00:00
vim.tlb updated for version 7.0001 2004-06-13 20:20:40 +00:00
vim16.def updated for version 7.0001 2004-06-13 20:20:40 +00:00
vim16.rc updated for version 7.0001 2004-06-13 20:20:40 +00:00
vim_alert.ico updated for version 7.0001 2004-06-13 20:20:40 +00:00
vim_error.ico updated for version 7.0001 2004-06-13 20:20:40 +00:00
vim_icon.xbm updated for version 7.0001 2004-06-13 20:20:40 +00:00
vim_info.ico updated for version 7.0001 2004-06-13 20:20:40 +00:00
vim_mask.xbm updated for version 7.0001 2004-06-13 20:20:40 +00:00
vim_quest.ico updated for version 7.0001 2004-06-13 20:20:40 +00:00
vimrun.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
vimtbar.dll updated for version 7.0001 2004-06-13 20:20:40 +00:00
vimtbar.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
vimtbar.lib updated for version 7.0001 2004-06-13 20:20:40 +00:00
vimtutor updated for version 7.0001 2004-06-13 20:20:40 +00:00
which.sh updated for version 7.0001 2004-06-13 20:20:40 +00:00
window.c updated for version 7.0006 2004-07-05 15:58:32 +00:00
workshop.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
workshop.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
wsdebug.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
wsdebug.h updated for version 7.0001 2004-06-13 20:20:40 +00:00
xpm_w32.c updated for version 7.0001 2004-06-13 20:20:40 +00:00
xpm_w32.h updated for version 7.0001 2004-06-13 20:20:40 +00:00

README for the 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 use
the ":tag" command to jump around 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):
	buffer.c	manipulating buffers (loaded files)
	diff.c		diff mode (vimdiff)
	eval.c		expression evaluation
	fileio.c	reading and writing files
	fold.c		folding
	getchar.c	getting characters and key mapping
	mark.c		marks
	memfile.c	storing lines for buffers in a swapfile
	memline.c	storing lines for buffers in memory
	menu.c		menus
	message.c	(error) messages
	mbyte.c		multy-byte character handling
	ops.c		handling operators ("d", "y", "p")
	option.c	options
	quickfix.c	quickfix commands (":make", ":cn")
	screen.c	updating the windows
	search.c	pattern searching
	tag.c		tags
	term.c		terminal handling, termcap codes
	undo.c		undo and redo
	window.c	handling split windows


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 triggerred
when going from the debugger to Vim and back.  To avoid this, recompile with
some code in gui_focus_change() disabled.